]> source.dussan.org Git - redmine.git/commitdiff
Refactor: Extract method
authorEric Davis <edavis@littlestreamsoftware.com>
Thu, 4 Mar 2010 05:33:54 +0000 (05:33 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Thu, 4 Mar 2010 05:33:54 +0000 (05:33 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3538 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/account_controller.rb

index b459906cb91915567a5ab259e04698638188a69c..8d807eb3c2068cdd7466d3bb2803c89d2649888f 100644 (file)
@@ -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])