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:
authorJames Lopez <james@jameslopez.es>2017-06-22 12:27:37 +0300
committerJames Lopez <james@jameslopez.es>2017-06-23 12:41:42 +0300
commitc9fd3dc42c462ce2551f6a9630035b4df00bc366 (patch)
tree5e4bd5226fff9fa00ba9db17056d21a59db527d7 /app/controllers/sessions_controller.rb
parent785cbb79e255c8369ca5eb916207304f39d188ad (diff)
more refactoring based on feedback
Diffstat (limited to 'app/controllers/sessions_controller.rb')
-rw-r--r--app/controllers/sessions_controller.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index f7d9d3c80c8..cc9038f7607 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -60,10 +60,11 @@ class SessionsController < Devise::SessionsController
return unless user && user.require_password?
- token = user.generate_reset_token
- Users::UpdateService.new(user, user).execute
+ Users::UpdateService.new(user, user).execute do |user|
+ @token = user.generate_reset_token
+ end
- redirect_to edit_user_password_path(reset_password_token: token),
+ redirect_to edit_user_password_path(reset_password_token: @token),
notice: "Please create a password for your new account."
end