1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Added paranoid mode to lockable

This commit is contained in:
Rodrigo Flores 2011-06-20 23:03:01 -03:00
parent 422bc4aaa6
commit 40c0a7b50b
2 changed files with 11 additions and 4 deletions

View file

@ -12,11 +12,17 @@ class Devise::UnlocksController < ApplicationController
def create
self.resource = resource_class.send_unlock_instructions(params[resource_name])
if resource.errors.empty?
set_flash_message :notice, :send_instructions if is_navigational_format?
respond_with resource, :location => new_session_path(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 => new_session_path(resource_name)
else
respond_with_navigational(resource){ render_with_scope :new }
end
end
end

View file

@ -40,6 +40,7 @@ en:
unlocks:
send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
unlocked: 'Your account was successfully unlocked. You are now signed in.'
send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
omniauth_callbacks:
success: 'Successfully authorized from %{kind} account.'
failure: 'Could not authorize you from %{kind} because "%{reason}".'