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:
parent
422bc4aaa6
commit
40c0a7b50b
2 changed files with 11 additions and 4 deletions
|
@ -12,6 +12,11 @@ class Devise::UnlocksController < ApplicationController
|
|||
def create
|
||||
self.resource = resource_class.send_unlock_instructions(params[resource_name])
|
||||
|
||||
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)
|
||||
|
@ -19,6 +24,7 @@ class Devise::UnlocksController < ApplicationController
|
|||
respond_with_navigational(resource){ render_with_scope :new }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# GET /resource/unlock?unlock_token=abcdef
|
||||
def show
|
||||
|
|
|
@ -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}".'
|
||||
|
|
Loading…
Reference in a new issue