gitlab-org--gitlab-foss/app/controllers/omniauth_callbacks_controller.rb
2012-01-28 16:23:17 +03:00

13 lines
381 B
Ruby

class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def ldap
# We only find ourselves here if the authentication to LDAP was successful.
omniauth = request.env["omniauth.auth"]["extra"]["raw_info"]
@user = User.find_for_ldap_auth(omniauth)
if @user.persisted?
@user.remember_me = true
end
sign_in_and_redirect @user
end
end