diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index b459906cb..8d807eb3c 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -27,12 +27,7 @@ class AccountController < ApplicationController if request.get? logout_user else - # Authenticate user - if Setting.openid? && using_open_id? - open_id_authenticate(params[:openid_url]) - else - password_authentication - end + authenticate_user end end @@ -138,6 +133,14 @@ class AccountController < ApplicationController self.logged_user = nil end + def authenticate_user + if Setting.openid? && using_open_id? + open_id_authenticate(params[:openid_url]) + else + password_authentication + end + end + def password_authentication user = User.try_to_login(params[:username], params[:password])