Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-04-08 21:26:04 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-04-08 23:06:56 +0300
commit57afaf9d92eb7d34d51d89ba7af350531f2e0fde (patch)
tree0e69c9cb977704a499805fea2b736c4d6876e44d /app/controllers/sessions_controller.rb
parente86e1013709735be5bb767e2b228930c543f25ae (diff)
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.rb8
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