2014-07-11 10:24:11 +00:00
|
|
|
class SessionsController < Devise::SessionsController
|
|
|
|
def new
|
2015-01-08 17:53:35 +00:00
|
|
|
redirect_path =
|
|
|
|
if request.referer.present? && (params['redirect_to_referer'] == 'yes')
|
|
|
|
referer_uri = URI(request.referer)
|
|
|
|
if referer_uri.host == Gitlab.config.gitlab.host
|
|
|
|
referer_uri.path
|
|
|
|
else
|
|
|
|
request.fullpath
|
|
|
|
end
|
|
|
|
else
|
|
|
|
request.fullpath
|
|
|
|
end
|
2014-07-22 06:34:16 +00:00
|
|
|
|
2014-07-25 16:30:25 +00:00
|
|
|
# Prevent a 'you are already signed in' message directly after signing:
|
|
|
|
# we should never redirect to '/users/sign_in' after signing in successfully.
|
|
|
|
unless redirect_path == '/users/sign_in'
|
|
|
|
store_location_for(:redirect, redirect_path)
|
|
|
|
end
|
2014-07-11 10:24:11 +00:00
|
|
|
|
2014-10-13 11:39:54 +00:00
|
|
|
if Gitlab.config.ldap.enabled
|
2014-10-14 11:11:53 +00:00
|
|
|
@ldap_servers = Gitlab::LDAP::Config.servers
|
2014-10-13 11:39:54 +00:00
|
|
|
end
|
|
|
|
|
2014-07-11 10:24:11 +00:00
|
|
|
super
|
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
|
|
super
|
|
|
|
end
|
|
|
|
end
|