-
Couldn't load subscription status.
- Fork 493
Description
This is easily replicated when spree_backend is set up with spree_auth_devise. I.e. without spree_frontend the / url is not available. If we then go to /admin, that redirects us to /admin/login and then returns us to /admin when logged in.
Now, if we log out and then log in, there is no session return path. It just tries to go to / and then error out if we don't have a spree_frontend or a landing page. Plus going to / while trying to login to /admin (even after the logging out) might not make much sense.
It is better if it goes to the Spree.admin_path when on the backend admin session controller https://github.com/spree/spree_auth_devise/blob/master/lib/controllers/backend/spree/admin/user_sessions_controller.rb.
Devise already supports fallback to a root_path when available. https://github.com/heartcombo/devise/blob/master/lib/devise/controllers/helpers.rb#L181