Commit 9714061b authored by Marin Jankovski's avatar Marin Jankovski

If the referer is not set, use fullpath.

parent cfde0936
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment