mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-10 15:28:18 -05:00
Move failed_attempts increment into its a function (#4351)
With this change one can overwrite when the incrementation is handled without duplicating the other `valid_for_authentication` logic.
This commit is contained in:
committed by
Leonardo Tegon
parent
5a3b7a1771
commit
7b3081760f
@@ -101,8 +101,7 @@ module Devise
|
||||
if super && !access_locked?
|
||||
true
|
||||
else
|
||||
self.failed_attempts ||= 0
|
||||
self.failed_attempts += 1
|
||||
increment_failed_attempts
|
||||
if attempts_exceeded?
|
||||
lock_access! unless access_locked?
|
||||
else
|
||||
@@ -111,6 +110,11 @@ module Devise
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def increment_failed_attempts
|
||||
self.failed_attempts ||= 0
|
||||
self.failed_attempts += 1
|
||||
end
|
||||
|
||||
def unauthenticated_message
|
||||
# If set to paranoid mode, do not show the locked message because it
|
||||
|
||||
Reference in New Issue
Block a user