mirror of
https://github.com/redmine/redmine.git
synced 2025-11-02 19:36:00 +01:00
Redirect to back_url or referer when clicking "Sign in" while already logged-in (#15926).
git-svn-id: http://svn.redmine.org/redmine/trunk@12705 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -373,7 +373,7 @@ class ApplicationController < ActionController::Base
|
||||
url
|
||||
end
|
||||
|
||||
def redirect_back_or_default(default)
|
||||
def redirect_back_or_default(default, options={})
|
||||
back_url = params[:back_url].to_s
|
||||
if back_url.present?
|
||||
begin
|
||||
@@ -387,6 +387,9 @@ class ApplicationController < ActionController::Base
|
||||
logger.warn("Could not redirect to invalid URL #{back_url}")
|
||||
# redirect to default
|
||||
end
|
||||
elsif options[:referer]
|
||||
redirect_to_referer_or default
|
||||
return
|
||||
end
|
||||
redirect_to default
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user