-
-
Notifications
You must be signed in to change notification settings - Fork 660
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
(fix): Enable Volto Login to Redirect Back to Original Route After Authentication #6419
Conversation
✅ Deploy Preview for plone-components canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this change work in multi-language sites, too, where the route may have a language prefix?
I think this is not a "fix" but a "feature". I have wanted this feature in Volto for a long time. Thanks for bringing it forward. |
Co-authored-by: Steve Piercy <web@stevepiercy.com>
@stevepiercy, yes it will work also on a multilingual site, because the login route is still the last one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
News item looks good. This still needs technical review before merging.
@dobri1408 Just thinking out loud, What about the cases where we have |
Perhaps I'm not understanding what this PR achieves, but can this not already be done by appending This is works by the path being caught in routes.js and the |
Confirmed! https://demo.plone.org/vertical-spacing/grid-and-text/login We should document this feature, as I never knew it existed. I imagine both end users and developers would want to know about it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JeffersonBledsoe @stevepiercy The release note was a bit misleading, so I suggested an edit. This is not about solving the general problem of taking you to where you were going after an interstitial login page. It's just a fix for a specific case where the login form was served at /fallback_login instead of /login, and didn't redirect anywhere after logging in.
* main: Client transforms for reducer data (#6422) (fix): Enable Volto Login to Redirect Back to Original Route After Authentication (#6419) Test with plone.restapi 9.8.0 (#6430) Add German translations for URL management control panel (#6429) URL Management control panel: add Edit feature (#6425) Remove SEAMLESS mention in bootstrap (#6424) Aliases control panel: Improve layout and add CSV upload (#6421) Fix site setup access at toolbar by using @actions endpoint. (#6413) Remove last CI tests still in 18 (#6418) Node 22 as LTS, main and recommended Volto version (#6371) Refactor Aliases control panel and support new filters (#6414) Remove the Plone app from apps folder (#6415) Release generate-volto 9.0.0-alpha.19 Release @plone/providers 1.0.0-alpha.3 Release @plone/components 2.0.0-alpha.16 Release @plone/client 1.0.0-alpha.19 Release @plone/types 1.0.0-alpha.21 Some types improvements/fixes (#6412)
There are situations where you may want the Volto login to appear on a route other than
/login
, as demonstrated in this example: https://github.com/collective/volto-authomatic/blob/a78f354e2c8fc4a41cf9d71d76a93f1d1627d268/src/index.js#L18. This implies that the Volto login should be accessible from any route invoked, thus the redirect after you are logged in should work also.To achieve this, I removed the hardcoded
/login
route and implemented a regex to strip the last segment of the route where the login was initiated.