mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Merge pull request #3029 from randoum/master
lock_access! better failure message
This commit is contained in:
commit
9818038a72
2 changed files with 8 additions and 2 deletions
|
@ -115,10 +115,10 @@ module Devise
|
|||
# leaks the existence of an account.
|
||||
if Devise.paranoid
|
||||
super
|
||||
elsif access_locked? || (lock_strategy_enabled?(:failed_attempts) && attempts_exceeded?)
|
||||
:locked
|
||||
elsif lock_strategy_enabled?(:failed_attempts) && last_attempt?
|
||||
:last_attempt
|
||||
elsif lock_strategy_enabled?(:failed_attempts) && attempts_exceeded?
|
||||
:locked
|
||||
else
|
||||
super
|
||||
end
|
||||
|
|
|
@ -313,4 +313,10 @@ class LockableTest < ActiveSupport::TestCase
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
test 'should return locked message if user was programatically locked' do
|
||||
user = create_user
|
||||
user.lock_access!
|
||||
assert_equal :locked, user.unauthenticated_message
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue