Only perform login action on explicit POST (#25653).

Patch by Holger Just.

git-svn-id: http://svn.redmine.org/redmine/trunk@16554 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2017-05-13 09:32:09 +00:00
parent b3ac4a6295
commit fee959675d

View File

@@ -34,12 +34,12 @@ class AccountController < ApplicationController
# Login request and validation
def login
if request.get?
if request.post?
authenticate_user
else
if User.current.logged?
redirect_back_or_default home_url, :referer => true
end
else
authenticate_user
end
rescue AuthSourceException => e
logger.error "An error occurred when authenticating #{params[:username]}: #{e.message}"