Skip to content
Snippets Groups Projects
Commit 9714061b authored by Marin Jankovski's avatar Marin Jankovski
Browse files

If the referer is not set, use fullpath.

parent cfde0936
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -2,7 +2,14 @@ class SessionsController < Devise::SessionsController
 
def new
if request.referer.present?
store_location_for(:redirect, URI(request.referer).path)
referer_uri = URI(request.referer)
if referer_uri.host == Gitlab.config.gitlab.host
store_location_for(:redirect, referer_uri.path)
else
store_location_for(:redirect, request.fullpath)
end
else
store_location_for(:redirect, request.fullpath)
end
 
super
Loading
Loading
Loading
Loading
@@ -17,6 +17,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
end
 
step 'I should see project "Community" home page' do
Gitlab.config.gitlab.stub(:host).and_return("www.example.com")
within '.project-home-title' do
page.should have_content 'Community'
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment