mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Paranoid mode on confirmable
This commit is contained in:
parent
76281ff15c
commit
225c89fbf1
2 changed files with 11 additions and 4 deletions
|
@ -11,11 +11,17 @@ class Devise::ConfirmationsController < ApplicationController
|
|||
def create
|
||||
self.resource = resource_class.send_confirmation_instructions(params[resource_name])
|
||||
|
||||
if resource.errors.empty?
|
||||
set_flash_message(:notice, :send_instructions) if is_navigational_format?
|
||||
respond_with resource, :location => after_resending_confirmation_instructions_path_for(resource_name)
|
||||
else
|
||||
if Devise.paranoid
|
||||
set_flash_message(:notice, :send_paranoid_instructions) if is_navigational_format?
|
||||
resource.errors.clear
|
||||
respond_with_navigational(resource){ render_with_scope :new }
|
||||
else
|
||||
if resource.errors.empty?
|
||||
set_flash_message(:notice, :send_instructions) if is_navigational_format?
|
||||
respond_with resource, :location => after_resending_confirmation_instructions_path_for(resource_name)
|
||||
else
|
||||
respond_with_navigational(resource){ render_with_scope :new }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ en:
|
|||
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.'
|
||||
send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
|
||||
confirmed: 'Your account was successfully confirmed. You are now signed in.'
|
||||
registrations:
|
||||
signed_up: 'Welcome! You have signed up successfully.'
|
||||
|
|
Loading…
Add table
Reference in a new issue