Remove spree.root route and respective controller. Also move

unauthorized route to main app.

This route is no longer used in OFN
This commit is contained in:
Luis Ramos
2020-06-26 10:05:26 +01:00
parent 7e75581da6
commit 4ee30d7cac
4 changed files with 2 additions and 12 deletions

View File

@@ -1,7 +0,0 @@
module Spree
class HomeController < Spree::StoreController
respond_to :html
def index; end
end
end

View File

@@ -9,6 +9,7 @@ Openfoodnetwork::Application.routes.draw do
get "/about_us", to: redirect(ContentConfig.footer_about_url)
get "/login", to: redirect("/#/login")
get '/unauthorized', :to => 'home#unauthorized', :as => :unauthorized
get "/discourse/login", to: "discourse_sso#login"
get "/discourse/sso", to: "discourse_sso#sso"

View File

@@ -1,7 +1,5 @@
# Overriding Devise routes to use our own controller
Spree::Core::Engine.routes.draw do
root to: 'home#index'
devise_for :spree_user,
:class_name => 'Spree::User',
:controllers => { :sessions => 'spree/user_sessions',
@@ -174,8 +172,6 @@ Spree::Core::Engine.routes.draw do
# Used by spree_paypal_express
get '/checkout/:state', :to => 'checkout#edit', :as => :checkout_state
get '/unauthorized', :to => 'home#unauthorized', :as => :unauthorized
get '/content/cvv', :to => 'content#cvv', :as => :cvv
get '/content/*path', :to => 'content#show', :as => :content
end

View File

@@ -30,7 +30,7 @@ module Spree
redirect_to '/unauthorized'
else
store_location
redirect_to respond_to?(:spree_login_path) ? spree_login_path : spree.root_path
redirect_to(respond_to?(:spree_login_path) ? spree_login_path : main_app.root_path)
end
end