Call store_location_for once.
This commit is contained in:
parent
9714061bb0
commit
b421750035
|
@ -1,16 +1,18 @@
|
||||||
class SessionsController < Devise::SessionsController
|
class SessionsController < Devise::SessionsController
|
||||||
|
|
||||||
def new
|
def new
|
||||||
if request.referer.present?
|
redirect_url = if request.referer.present?
|
||||||
referer_uri = URI(request.referer)
|
referer_uri = URI(request.referer)
|
||||||
if referer_uri.host == Gitlab.config.gitlab.host
|
if referer_uri.host == Gitlab.config.gitlab.host
|
||||||
store_location_for(:redirect, referer_uri.path)
|
referer_uri.path
|
||||||
else
|
else
|
||||||
store_location_for(:redirect, request.fullpath)
|
request.fullpath
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
store_location_for(:redirect, request.fullpath)
|
request.fullpath
|
||||||
end
|
end
|
||||||
|
|
||||||
|
store_location_for(:redirect, redirect_url)
|
||||||
|
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue