diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-04-08 14:26:04 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-04-08 16:06:56 -0400 |
commit | 57afaf9d92eb7d34d51d89ba7af350531f2e0fde (patch) | |
tree | 0e69c9cb977704a499805fea2b736c4d6876e44d /app/controllers/sessions_controller.rb | |
parent | e86e1013709735be5bb767e2b228930c543f25ae (diff) | |
download | gitlab-ce-57afaf9d92eb7d34d51d89ba7af350531f2e0fde.tar.gz |
Upon successful login, clear `reset_password_token` field
Closes #1942
Diffstat (limited to 'app/controllers/sessions_controller.rb')
-rw-r--r-- | app/controllers/sessions_controller.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 7b6982c5074..3f11d7afe6f 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -26,6 +26,12 @@ class SessionsController < Devise::SessionsController end def create - super + super do |resource| + # User has successfully signed in, so clear any unused reset tokens + if resource.reset_password_token.present? + resource.update_attributes(reset_password_token: nil, + reset_password_sent_at: nil) + end + end end end |