mirror of
https://github.com/redmine/redmine.git
synced 2025-11-01 10:56:17 +01:00
Handles the case when an expired token is in the users session (#29781).
Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@17601 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -62,9 +62,15 @@ class AccountController < ApplicationController
|
||||
(redirect_to(home_url); return) unless Setting.lost_password?
|
||||
if prt = (params[:token] || session[:password_recovery_token])
|
||||
@token = Token.find_token("recovery", prt.to_s)
|
||||
if @token.nil? || @token.expired?
|
||||
if @token.nil?
|
||||
redirect_to home_url
|
||||
return
|
||||
elsif @token.expired?
|
||||
# remove expired token from session and let user try again
|
||||
session[:password_recovery_token] = nil
|
||||
flash[:error] = l(:error_token_expired)
|
||||
redirect_to lost_password_url
|
||||
return
|
||||
end
|
||||
|
||||
# redirect to remove the token query parameter from the URL and add it to the session
|
||||
|
||||
Reference in New Issue
Block a user