summaryrefslogtreecommitdiff
path: root/app/controllers/omniauth_callbacks_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-09-02 23:35:40 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-09-02 23:35:40 +0300
commit6bf117c601eda2ae3045644ab778d167955cd0c3 (patch)
tree9a11fa1cc2557e4b7dcf5eb303c2ad91ab26998c /app/controllers/omniauth_callbacks_controller.rb
parent1f3f874142775ba6d074460a570c69e1fb02e096 (diff)
downloadgitlab-ce-6bf117c601eda2ae3045644ab778d167955cd0c3.tar.gz
Mode User+LDAP functionality from Gitlab::Auth
Diffstat (limited to 'app/controllers/omniauth_callbacks_controller.rb')
-rw-r--r--app/controllers/omniauth_callbacks_controller.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb
index c4ebf0e4889..b0765672dda 100644
--- a/app/controllers/omniauth_callbacks_controller.rb
+++ b/app/controllers/omniauth_callbacks_controller.rb
@@ -16,12 +16,12 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
end
def ldap
- # We only find ourselves here if the authentication to LDAP was successful.
- @user = User.find_for_ldap_auth(request.env["omniauth.auth"], current_user)
- if @user.persisted?
- @user.remember_me = true
- end
- sign_in_and_redirect @user
+ # We only find ourselves here
+ # if the authentication to LDAP was successful.
+ @user = Gitlab::LDAP::User.find_or_create(request.env["omniauth.auth"])
+ @user.remember_me = true if @user.persisted?
+
+ sign_in_and_redirect(@user)
end
private