Remove conflicting and duplicate route

This Spree route conflicts with the one we define:

```
get "/login", to: redirect("/#/login")
```

for whatever reason there are 7 users that managed to hit the Spree one
instead of ours when confirming their signup email. It's not clear to me
though when this `/login?validation=confirmed` is really hit. The
confirmation email link passes a token in the query params and this is
not the case.

The idea is that `GET /login` makes the login modal to show up instead
of Devise's default behaviour (through inheritance) of showing a login
form page. OFN was never prepared to handle this as this bug proofs.
This commit is contained in:
Pau Perez
2020-07-21 11:55:53 +02:00
parent 62a3b6b720
commit 9be199a6cc
4 changed files with 5 additions and 4 deletions

View File

@@ -59,7 +59,7 @@ module Spree
if @user
authorize! params[:action].to_sym, @user
else
redirect_to spree.login_path
redirect_to main_app.login_path
end
end

View File

@@ -10,7 +10,7 @@ class UserPasswordsController < Spree::UserPasswordsController
if resource.errors.empty?
set_flash_message(:success, :send_instructions) if is_navigational_format?
respond_with resource, location: spree.login_path
respond_with resource, location: main_app.login_path
else
respond_to do |format|
format.html do

View File

@@ -15,7 +15,6 @@ Spree::Core::Engine.routes.draw do
resources :users, :only => [:edit, :update]
devise_scope :spree_user do
get '/login' => 'user_sessions#new', :as => :login
post '/login' => 'user_sessions#create', :as => :create_new_session
get '/logout' => 'user_sessions#destroy', :as => :logout
get '/signup' => 'user_registrations#new', :as => :signup

View File

@@ -11,7 +11,9 @@ module Spree
current_spree_user
end
delegate :login_path, to: :spree, prefix: true
def spree_login_path
main_app.login_path
end
delegate :signup_path, to: :spree, prefix: true