After a password reset, don't show "You are now signed in." if the user can't be signed-in anyway.
This commit is contained in:
parent
eba53f8f94
commit
ebbabaea5b
|
@ -32,7 +32,8 @@ class Devise::PasswordsController < ApplicationController
|
|||
self.resource = resource_class.reset_password_by_token(params[resource_name])
|
||||
|
||||
if resource.errors.empty?
|
||||
set_flash_message(:notice, :updated) if is_navigational_format?
|
||||
flash_message = resource.active_for_authentication? ? :updated : :updated_not_active
|
||||
set_flash_message(:notice, flash_message) if is_navigational_format?
|
||||
sign_in(resource_name, resource)
|
||||
respond_with resource, :location => redirect_location(resource_name, resource)
|
||||
else
|
||||
|
|
|
@ -27,6 +27,7 @@ en:
|
|||
passwords:
|
||||
send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
|
||||
updated: 'Your password was changed successfully. You are now signed in.'
|
||||
updated_not_active: 'Your password was changed successfully.'
|
||||
send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
|
||||
confirmations:
|
||||
send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
|
||||
|
|
|
@ -147,7 +147,7 @@ class PasswordTest < ActionController::IntegrationTest
|
|||
reset_password :reset_password_token => user.reload.reset_password_token
|
||||
|
||||
assert_current_url '/'
|
||||
assert_contain 'Your password was changed successfully.'
|
||||
assert_contain 'Your password was changed successfully. You are now signed in.'
|
||||
assert user.reload.valid_password?('987654321')
|
||||
end
|
||||
|
||||
|
@ -179,6 +179,8 @@ class PasswordTest < ActionController::IntegrationTest
|
|||
request_forgot_password
|
||||
reset_password :reset_password_token => user.reload.reset_password_token
|
||||
|
||||
assert_contain 'Your password was changed successfully.'
|
||||
assert_not_contain 'You are now signed in.'
|
||||
assert_equal new_user_session_path, @request.path
|
||||
assert !warden.authenticated?(:user)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue