Skip to content

Commit

Permalink
Paranoid mode on confirmable
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Flores committed Jun 22, 2011
1 parent 76281ff commit 225c89f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/controllers/devise/confirmations_controller.rb
Expand Up @@ -11,11 +11,17 @@ def new
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

Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Expand Up @@ -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.'
Expand Down

0 comments on commit 225c89f

Please sign in to comment.