HTTPS clone URL
Subversion checkout URL
Please sign in to comment.
Merge pull request #1726 from plataformatec/failed_attempts
Setting failed_attempts to 0 after sign in
- Loading branch information...
Showing with 27 additions and 11 deletions.
|@@ -0,0 +1,7 @@|
|+# After each sign in, if resource responds to failed_attempts, sets it to 0|
|+# This is only triggered when the user is explicitly set (with set_user)|
|+Warden::Manager.after_set_user :except => :fetch do |record, warden, options||
|+ if record.respond_to?(:failed_attempts) && warden.authenticated?(options[:scope])|
|+ record.update_attribute(:failed_attempts, 0)|