From 4150200fec48fe1346c70d4322029d4400a9d085 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 27 May 2017 07:34:42 +0000 Subject: [PATCH] Merged r16554 and r16555 (#25653). git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@16563 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/account_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 10516bc8c..506d0b496 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -32,12 +32,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 occured when authenticating #{params[:username]}: #{e.message}" @@ -123,7 +123,7 @@ class AccountController < ApplicationController # User self-registration def register (redirect_to(home_url); return) unless Setting.self_registration? || session[:auth_source_registration] - if request.get? + if !request.post? session[:auth_source_registration] = nil @user = User.new(:language => current_language.to_s) else -- 2.39.5