Commit bc79caaf authored by Eric Davis's avatar Eric Davis

Refactor: Extract method

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3537 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent be20d980
......@@ -25,8 +25,7 @@ class AccountController < ApplicationController
# Login request and validation
def login
if request.get?
# Logout user
self.logged_user = nil
logout_user
else
# Authenticate user
if Setting.openid? && using_open_id?
......@@ -39,9 +38,7 @@ class AccountController < ApplicationController
# Log out current user and redirect to welcome page
def logout
cookies.delete :autologin
Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) if User.current.logged?
self.logged_user = nil
logout_user
redirect_to home_url
end
......@@ -134,7 +131,13 @@ class AccountController < ApplicationController
end
private
def logout_user
cookies.delete :autologin
Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) if User.current.logged?
self.logged_user = nil
end
def password_authentication
user = User.try_to_login(params[:username], params[:password])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment