gitlabhq/app/controllers/omniauth_callbacks_controller.rb

14 lines
381 B
Ruby
Raw Normal View History

2012-01-28 14:23:17 +01:00
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