X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/fad9a10dc26dc6e200fc3d18f23a31c7f36306bb..6094a97ce6297d390e5bbf733f5c2b4cc6b2076c:/app/controllers/passwords_controller.rb?ds=sidebyside diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index 25b2b9607..26b21b6d9 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -19,8 +19,7 @@ class PasswordsController < ApplicationController @title = t ".title" if params[:token] - self.current_user = User.find_by_token_for(:password_reset, params[:token]) || - UserToken.unexpired.find_by(:token => params[:token])&.user + self.current_user = User.find_by_token_for(:password_reset, params[:token]) if current_user.nil? flash[:error] = t ".flash token bad" @@ -51,8 +50,7 @@ class PasswordsController < ApplicationController def update if params[:token] - self.current_user = User.find_by_token_for(:password_reset, params[:token]) || - UserToken.unexpired.find_by(:token => params[:token])&.user + self.current_user = User.find_by_token_for(:password_reset, params[:token]) if current_user if params[:user] @@ -62,7 +60,6 @@ class PasswordsController < ApplicationController current_user.email_valid = true if current_user.save - UserToken.delete_by(:token => params[:token]) session[:fingerprint] = current_user.fingerprint flash[:notice] = t ".flash changed" successful_login(current_user)