From 2111ace158f3dd9496d49f82529074d77557b2d2 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 16 Apr 2015 11:14:57 +0100 Subject: [PATCH] Prefer username/password to openid_url if both are set --- app/controllers/user_controller.rb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index c7e44dab6..fcd330ec3 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -252,14 +252,12 @@ class UserController < ApplicationController def login session[:referer] = params[:referer] if params[:referer] - if params[:username] || params[:openid_url] - if params[:openid_url].present? - session[:remember_me] ||= params[:remember_me_openid] - redirect_to auth_url("openid", params[:openid_url]) - else - session[:remember_me] ||= params[:remember_me] - password_authentication(params[:username], params[:password]) - end + if params[:username].present? && params[:password].present? + session[:remember_me] ||= params[:remember_me] + password_authentication(params[:username], params[:password]) + elsif params[:openid_url].present? + session[:remember_me] ||= params[:remember_me_openid] + redirect_to auth_url("openid", params[:openid_url]) end end -- 2.39.5