mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Fixes incorrect flash message on confirmation
The :confirmed default message in devise.en.yml used to say "You are now signed in." This is no longer the default behavior in v3.1.0. This commit renames that message to :confirmed_and_signed_in and changes the :confirmed message to be appropriate for the default post- confirmation location (which is now the new session page). The new :confirmed message reads: "Your account was successfully confirmed. Please sign in."
This commit is contained in:
parent
f6a74e90e5
commit
fc251c306c
2 changed files with 8 additions and 3 deletions
|
@ -20,8 +20,12 @@ class Devise::ConfirmationsController < DeviseController
|
|||
self.resource = resource_class.confirm_by_token(params[:confirmation_token])
|
||||
|
||||
if resource.errors.empty?
|
||||
set_flash_message(:notice, :confirmed) if is_navigational_format?
|
||||
sign_in(resource_name, resource) if Devise.allow_insecure_sign_in_after_confirmation
|
||||
if Devise.allow_insecure_sign_in_after_confirmation
|
||||
set_flash_message(:notice, :confirmed_and_signed_in) if is_navigational_format?
|
||||
sign_in(resource_name, resource)
|
||||
else
|
||||
set_flash_message(:notice, :confirmed) if is_navigational_format?
|
||||
end
|
||||
respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource) }
|
||||
else
|
||||
respond_with_navigational(resource.errors, :status => :unprocessable_entity){ render :new }
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
en:
|
||||
devise:
|
||||
confirmations:
|
||||
confirmed: "Your account was successfully confirmed. You are now signed in."
|
||||
confirmed: "Your account was successfully confirmed. Please sign in."
|
||||
confirmed_and_signed_in: "Your account was successfully confirmed. You are now signed in."
|
||||
send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
|
||||
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
|
||||
failure:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue