devise 5.0.1 → 5.0.2

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: 2c59c4076a4ac0e38c7200826104c1525bff002d6df36b40733c6b011454803c
4
- data.tar.gz: 24e6a187f45db8fb798b1e4ead4ae0d9c456c689d1bd57a488ea8b6daa5f094d
3
+ metadata.gz: 4cffe2aa12ff3240ea7c769cce8f54514bcbf3b7937e3cae3e530fa38c504610
4
+ data.tar.gz: 47999dcc6dbe990d3c809b35fa138b071f5b2fa0411600093a9b4926c32567a8
5
5
  SHA512:
6
- metadata.gz: d9a4c77df23aa110e19620d6cf0de5c6585d0c7af4dbb28c71e86b0b67746b753a088796b7951d571d2142133bb6376a614a3c3f6fec587709a0979a7886ca76
7
- data.tar.gz: 8c9c549e0f6e08950b926f56fdca67c494d94aa0ca17b2af2b95b2b703ac7a2e93750897febfaef8aa4364430d5a3bf4004f8c638d34becd2690e0bcbb8f9542
6
+ metadata.gz: 7f40111655bc0aee66e0d02c29af7113053aa98f5c33445cccb7dbc1f8a5132ace75a2be82e9302264dfc0de579f835330eb65cf55e4d29ea4a0b4a30326ac40
7
+ data.tar.gz: 99e6e990cefbbdce6a851c1da5249d9ec04a7e24be193ba674052809112da1de6867ed0930f27342c80867974532aceb77fa05b28f45aebd7338d015bb168e4e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 5.0.2 - 2026-02-18
2
+
3
+ * enhancements
4
+ * Allow resource class scopes to override the global configuration for `sign_in_after_change_password` behaviour. [#5825](https://github.com/heartcombo/devise/pull/5825)
5
+ * Add `sign_in_after_reset_password?` check hook to passwords controller, to allow it to be customized by users. [#5826](https://github.com/heartcombo/devise/pull/5826)
6
+
1
7
  ### 5.0.1 - 2026-02-13
2
8
 
3
9
  * bug fixes
@@ -36,7 +36,7 @@ class Devise::PasswordsController < DeviseController
36
36
 
37
37
  if resource.errors.empty?
38
38
  resource.unlock_access! if unlockable?(resource)
39
- if resource_class.sign_in_after_reset_password
39
+ if sign_in_after_reset_password?
40
40
  flash_message = resource.active_for_authentication? ? :updated : :updated_not_active
41
41
  set_flash_message!(:notice, flash_message)
42
42
  resource.after_database_authentication
@@ -53,7 +53,7 @@ class Devise::PasswordsController < DeviseController
53
53
 
54
54
  protected
55
55
  def after_resetting_password_path_for(resource)
56
- resource_class.sign_in_after_reset_password ? after_sign_in_path_for(resource) : new_session_path(resource_name)
56
+ sign_in_after_reset_password? ? after_sign_in_path_for(resource) : new_session_path(resource_name)
57
57
  end
58
58
 
59
59
  # The path used after sending reset password instructions
@@ -69,6 +69,11 @@ class Devise::PasswordsController < DeviseController
69
69
  end
70
70
  end
71
71
 
72
+ # Check if the user should be signed in automatically after resetting the password.
73
+ def sign_in_after_reset_password?
74
+ resource_class.sign_in_after_reset_password
75
+ end
76
+
72
77
  # Check if proper Lockable module methods are present & unlock strategy
73
78
  # allows to unlock resource on password reset
74
79
  def unlockable?(resource)
@@ -82,12 +82,6 @@ class Devise::RegistrationsController < DeviseController
82
82
 
83
83
  protected
84
84
 
85
- def update_needs_confirmation?(resource, previous)
86
- resource.respond_to?(:pending_reconfirmation?) &&
87
- resource.pending_reconfirmation? &&
88
- previous != resource.unconfirmed_email
89
- end
90
-
91
85
  # By default we want to require a password checks on update.
92
86
  # You can overwrite this method in your own RegistrationsController.
93
87
  def update_resource(resource, params)
@@ -133,6 +127,13 @@ class Devise::RegistrationsController < DeviseController
133
127
  self.resource = send(:"current_#{resource_name}")
134
128
  end
135
129
 
130
+ # Check if the user should be signed in automatically after updating the password.
131
+ def sign_in_after_change_password?
132
+ return true if account_update_params[:password].blank?
133
+
134
+ resource_class.sign_in_after_change_password
135
+ end
136
+
136
137
  def sign_up_params
137
138
  devise_parameter_sanitizer.sanitize(:sign_up)
138
139
  end
@@ -160,9 +161,9 @@ class Devise::RegistrationsController < DeviseController
160
161
  set_flash_message :notice, flash_key
161
162
  end
162
163
 
163
- def sign_in_after_change_password?
164
- return true if account_update_params[:password].blank?
165
-
166
- Devise.sign_in_after_change_password
164
+ def update_needs_confirmation?(resource, previous)
165
+ resource.respond_to?(:pending_reconfirmation?) &&
166
+ resource.pending_reconfirmation? &&
167
+ previous != resource.unconfirmed_email
167
168
  end
168
169
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Devise
4
- VERSION = "5.0.1".freeze
4
+ VERSION = "5.0.2".freeze
5
5
  end
@@ -11,7 +11,7 @@
11
11
  </div>
12
12
 
13
13
  <div class="form-actions">
14
- <%= f.button :submit, "Send me reset password instructions" %>
14
+ <%= f.button :submit, "Send me password reset instructions" %>
15
15
  </div>
16
16
  <% end %>
17
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Valim
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  requirements: []
224
- rubygems_version: 4.0.3
224
+ rubygems_version: 4.0.6
225
225
  specification_version: 4
226
226
  summary: Flexible authentication solution for Rails with Warden
227
227
  test_files: []