gitlabhq/app/controllers/omniauth_callbacks_controller.rb

14 lines
360 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.
info = request.env["omniauth.auth"]["info"]
@user = User.find_for_ldap_auth(info)
2012-01-28 14:23:17 +01:00
if @user.persisted?
@user.remember_me = true
end
sign_in_and_redirect @user
end
end