- 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 user
token = user.generate_token_for(:password_reset)
UserMailer.lost_password(user, token).deliver_later
if user
token = user.generate_token_for(:password_reset)
UserMailer.lost_password(user, token).deliver_later
- 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])
session[:fingerprint] = current_user.fingerprint
flash[:notice] = t ".flash changed"
successful_login(current_user)
session[:fingerprint] = current_user.fingerprint
flash[:notice] = t ".flash changed"
successful_login(current_user)