Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spree backend user session fallback root path is not admin_path #535

Open
bhtabor opened this issue Jul 7, 2021 · 0 comments
Open

Spree backend user session fallback root path is not admin_path #535

bhtabor opened this issue Jul 7, 2021 · 0 comments

Comments

@bhtabor
Copy link

bhtabor commented Jul 7, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant