gitlab-org--gitlab-foss/app/controllers/omniauth_callbacks_controll...

14 lines
360 B
Ruby
Raw Normal View History

2012-01-28 13:23:17 +00: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 13:23:17 +00:00
if @user.persisted?
@user.remember_me = true
end
sign_in_and_redirect @user
end
end