mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Fixing a nil bug in the referrer handling on login
This commit is contained in:
@@ -7,8 +7,11 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
|
||||
def after_sign_in_path_for(resource)
|
||||
referer_path = URI(request.referer).path
|
||||
[main_app.shop_checkout_path].include?(referer_path) ? referer_path : root_path
|
||||
if request.referer and referer_path = URI(request.referer).path
|
||||
[main_app.shop_checkout_path].include?(referer_path) ? referer_path : root_path
|
||||
else
|
||||
root_path
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -31,5 +31,4 @@ feature %q{
|
||||
page.should_not have_content "ComfortableMexicanSofa"
|
||||
page.should have_content "WHERE WOULD YOU LIKE TO SHOP?"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user