rodauth 2.45.0 → 2.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dea248f50448b260c6d0007d8bc4054f17794270e857a6310b969ba58105fbf
4
- data.tar.gz: 875dbda4ddd85b04041a8e854e0adb09b466269ecef74dd1a73f384519d54553
3
+ metadata.gz: 5f2f00f0b0ca5043b852e3f544a666c066b5df09445a4d0031351e37d101bdbf
4
+ data.tar.gz: 387de7af25a3d6f4823cc09818d374ff99f1a35ffe8a0329efe107810667cdd6
5
5
  SHA512:
6
- metadata.gz: dbf7c82f8b1c93496c59225891c1d747f317eaf46d8283f9c6f2d0562a48aaaec4d6491ed7567011356914fb4498e0f86576c230e183cf53c0ac7a7c5f27d99a
7
- data.tar.gz: c8c2a228ce0395e4e14dbd1a69b01f7038b2ac94267b33bc5695d11b3eae6a278846be5100714dc18b0a65010db1693c0621f9ec1f2d0ba0793e92b61a698bf9
6
+ metadata.gz: 26088c4dc223cdc9f72a07a0de27bff3a3678b29264a46554733d103106443988ac524553f8afa4cb7a457d0cf51c25646adbdf8bd158a7488db449dfc09f7ee
7
+ data.tar.gz: da69371a181d62e7ebb74274c56503565e64be26a808dede0df3f7b7c1e230efa5442f35d99609c138439703d2f97335968a0ee720c83c9819ae0de363269046
@@ -55,6 +55,7 @@ module Rodauth
55
55
  transaction do
56
56
  before_change_password
57
57
  set_password(password)
58
+ clear_tokens(:change_password)
58
59
  after_change_password
59
60
  end
60
61
  change_password_response
@@ -0,0 +1,17 @@
1
+ # frozen-string-literal: true
2
+
3
+ module Rodauth
4
+ Feature.define(:close_account_email, :CloseAccountEmail) do
5
+ depends :close_account, :email_base
6
+
7
+ loaded_templates %w'close-account-email'
8
+ email :close_account, 'Account Closed', :translatable=>true
9
+
10
+ private
11
+
12
+ def after_close_account
13
+ super
14
+ send_close_account_email
15
+ end
16
+ end
17
+ end
@@ -64,8 +64,7 @@ module Rodauth
64
64
 
65
65
  def account_from_key(token, status_id=nil)
66
66
  id, key = split_token(token)
67
- id = convert_token_id(id)
68
- return unless id && key
67
+ return unless key && (id = convert_token_id(id))
69
68
 
70
69
  return unless actual = yield(id)
71
70
 
@@ -133,12 +133,10 @@ module Rodauth
133
133
 
134
134
  def _account_refresh_token_split(token)
135
135
  id, token = split_token(token)
136
- id = convert_token_id(id)
137
- return unless id && token
136
+ return unless token && (id = convert_token_id(id))
138
137
 
139
138
  token_id, key = split_token(token)
140
- token_id = convert_token_id(token_id)
141
- return unless token_id && key
139
+ return unless key && (token_id = convert_token_id(token_id))
142
140
 
143
141
  [id, token_id, key]
144
142
  end
@@ -225,7 +225,7 @@ module Rodauth
225
225
  end
226
226
 
227
227
  def set_verify_account_email_last_sent
228
- verify_account_ds.update(verify_account_email_last_sent_column=>Sequel::CURRENT_TIMESTAMP) if verify_account_email_last_sent_column
228
+ verify_account_ds.update(verify_account_email_last_sent_column=>Sequel::CURRENT_TIMESTAMP) if verify_account_email_last_sent_column
229
229
  end
230
230
 
231
231
  def get_verify_account_email_last_sent
@@ -248,7 +248,16 @@ module Rodauth
248
248
 
249
249
  def clear_tokens(reason)
250
250
  super
251
- remove_verify_account_key
251
+ if reason == :close_account
252
+ remove_verify_account_key
253
+ else
254
+ generate_verify_account_key_value
255
+ hash = {verify_account_key_column=>verify_account_key_value}
256
+ if verify_account_email_last_sent_column
257
+ hash[verify_account_email_last_sent_column] = Time.now - verify_account_skip_resend_email_within - 10
258
+ end
259
+ verify_account_ds.update(hash)
260
+ end
252
261
  end
253
262
 
254
263
  private
@@ -93,7 +93,12 @@ module Rodauth
93
93
  end
94
94
 
95
95
  def webauthn_account_id
96
- super || account_id
96
+ case @current_route
97
+ when :login, :webauthn_login, nil # nil for internal request
98
+ account_id
99
+ else
100
+ super
101
+ end
97
102
  end
98
103
  end
99
104
  end
@@ -6,7 +6,7 @@ module Rodauth
6
6
  MAJOR = 2
7
7
 
8
8
  # The minor version of Rodauth, updated for new feature releases of Rodauth.
9
- MINOR = 45
9
+ MINOR = 46
10
10
 
11
11
  # The patch version of Rodauth, updated only for bug fixes from the last
12
12
  # feature release.
@@ -0,0 +1,2 @@
1
+ Someone (hopefully you) has closed the account associated to this
2
+ email address.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rodauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.45.0
4
+ version: 2.46.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
@@ -265,6 +265,7 @@ files:
265
265
  - lib/rodauth/features/change_password.rb
266
266
  - lib/rodauth/features/change_password_notify.rb
267
267
  - lib/rodauth/features/close_account.rb
268
+ - lib/rodauth/features/close_account_email.rb
268
269
  - lib/rodauth/features/confirm_password.rb
269
270
  - lib/rodauth/features/create_account.rb
270
271
  - lib/rodauth/features/disallow_common_passwords.rb
@@ -314,6 +315,7 @@ files:
314
315
  - templates/button.str
315
316
  - templates/change-login.str
316
317
  - templates/change-password.str
318
+ - templates/close-account-email.str
317
319
  - templates/close-account.str
318
320
  - templates/confirm-password.str
319
321
  - templates/create-account.str
@@ -403,7 +405,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
403
405
  - !ruby/object:Gem::Version
404
406
  version: '0'
405
407
  requirements: []
406
- rubygems_version: 4.0.10
408
+ rubygems_version: 4.0.16
407
409
  specification_version: 4
408
410
  summary: Authentication and Account Management Framework for Rack Applications
409
411
  test_files: []