Issue 4895: Add `after_database_authentication` callback after sign_in immediately after password update (#4916)
This commit is contained in:
parent
aa6cb411bc
commit
bafc23eae5
|
@ -39,6 +39,7 @@ class Devise::PasswordsController < DeviseController
|
|||
if Devise.sign_in_after_reset_password
|
||||
flash_message = resource.active_for_authentication? ? :updated : :updated_not_active
|
||||
set_flash_message!(:notice, flash_message)
|
||||
resource.after_database_authentication
|
||||
sign_in(resource_name, resource)
|
||||
else
|
||||
set_flash_message!(:notice, :updated_not_active)
|
||||
|
|
|
@ -31,4 +31,9 @@ class PasswordsControllerTest < Devise::ControllerTestCase
|
|||
put_update_with_params
|
||||
assert_redirected_to custom_path
|
||||
end
|
||||
|
||||
test 'calls after_database_authentication callback after sign_in immediately after password update' do
|
||||
User.any_instance.expects :after_database_authentication
|
||||
put_update_with_params
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue