Refactor: Extract method
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3538 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
bc79caaf69
commit
afdcd770dc
|
@ -27,12 +27,7 @@ class AccountController < ApplicationController
|
||||||
if request.get?
|
if request.get?
|
||||||
logout_user
|
logout_user
|
||||||
else
|
else
|
||||||
# Authenticate user
|
authenticate_user
|
||||||
if Setting.openid? && using_open_id?
|
|
||||||
open_id_authenticate(params[:openid_url])
|
|
||||||
else
|
|
||||||
password_authentication
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -138,6 +133,14 @@ class AccountController < ApplicationController
|
||||||
self.logged_user = nil
|
self.logged_user = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def authenticate_user
|
||||||
|
if Setting.openid? && using_open_id?
|
||||||
|
open_id_authenticate(params[:openid_url])
|
||||||
|
else
|
||||||
|
password_authentication
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def password_authentication
|
def password_authentication
|
||||||
user = User.try_to_login(params[:username], params[:password])
|
user = User.try_to_login(params[:username], params[:password])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue