solidusio / solidus_auth_devise

🔑 Devise authentication for your Solidus store.
http://solidus.io
BSD 3-Clause "New" or "Revised" License
52 stars 124 forks source link

Only use custom routes #237

Open elia opened 1 year ago

elia commented 1 year ago

Summary

Using both devise generated routes and custom ones is confusing.

As an example: when failing authentication, the devise route would send the user to "new_spree_user_session_path", however we want our users to be redirected to "/login." This commit deprecates the route and sends users to "/login."

This PR maintains full support for existing routes allowing stores to copy them in their routes file if they want to continue using them.

Visiting /user/spree_user/sign_up the logs will show this deprecation message:

DEPRECATION WARNING: This route is deprecated: "/user/spree_user/sign_up".
It will be removed in solidus_auth_devise v3.
If you want to continue using this route please define it in your application code:

Spree::Core::Engine.routes.draw do
  devise_scope :spree_user do
    get "/user/spree_user/sign_up", to: spree/user_registrations#new, ...
  end
end

Please check your application for places in which this route was generated.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed (~cross them out~ if they are not):