Merge pull request #8808 from Matt-Yorkley/login-modal

Remove all Angular code from Login/Signup process
This commit is contained in:
Filipe
2022-02-03 19:36:44 +00:00
committed by GitHub
54 changed files with 509 additions and 500 deletions

View File

@@ -38,6 +38,7 @@ class ApplicationController < ActionController::Base
include Spree::Core::ControllerHelpers::Common
before_action :set_cache_headers # prevent cart emptying via cache when using back button #1213
before_action :set_after_login_url
include RawParams
include EnterprisesHelper
@@ -61,15 +62,9 @@ class ApplicationController < ActionController::Base
end
def set_checkout_redirect
referer_path = OpenFoodNetwork::RefererParser.path(request.referer)
if referer_path
is_checkout_path_the_referer = [main_app.checkout_path].include?(referer_path)
session["spree_user_return_to"] = if is_checkout_path_the_referer
referer_path
else
main_app.root_path
end
end
return unless URI(request.referer.to_s).path == main_app.checkout_path
session["spree_user_return_to"] = main_app.checkout_path
end
def shopfront_session
@@ -102,6 +97,10 @@ class ApplicationController < ActionController::Base
private
def set_after_login_url
store_location_for(:spree_user, params[:after_login]) if params[:after_login]
end
def shopfront_redirect
session[:shopfront_redirect]
end
@@ -111,7 +110,7 @@ class ApplicationController < ActionController::Base
end
def require_distributor_chosen
unless @distributor = current_distributor
unless (@distributor = current_distributor)
redirect_to main_app.root_path
false
end