How to redirect Webflow users back to their pre-login page after successful authentication? Answered
Hello everyone! Is there a way where we can implement a feature that redirects a user back to a page they were attempting to access without authentication, but only after they have successfully logged in. Could you please provide some guidance on how to achieve this functionality on Webflow?
Comments
10 comments
I do know a way to do this, and I've made it a cloneable! Sending
https://webflow.com/made-in-webflow/website/dont-redirect-on-login-memberstack
If this isn't what you're after, I can figure something else out most likely
Hi Julian Galluzzo, thanks for sharing this. We’ll give this a try and let you know if we face any issues.
any plans for such redirect attribute?
Hi guys, do you have any suggestions for this?
Normally I can set the ridirection after login in the memberstack setting (as in the attached screenshot).
Is it possible to dynamically redirect the user after logging in to the same page he was visiting?
E.g. I'm visiting the Services page, click on Login (in the navigation) and go to the Login page where I can login using my credentials. After logging in, I want to be redirected back to the "Services" page. Is this possible? Thank you very much!
Hey Biagio Della Rocca, yes this should be possible. You just need to add data-ms-redirect="current-url" attribute to the Login button. With this, whenever a user clicks on this button, after logging in they will be redirected to the page they chose the "login" button from. More info can be found here.
This is exactly what I was looking for, thank you very much AJ!
This is amazing….i was literally coming here to as a similar question….AJ, is it possible to redirect a user to a custom page based on a collection template that requires a unique user slug at the end?
Hey Gregory Bishop, yes this same attribute will work for collection template pages as well. For example, if the login button is on a page with the URL https://www.website.com/collection-name/item-name, the user will be redirected to the page with that same URL after logging in.
i am using passwordless logins…..using the code send, or google, facebook, and linkedin. Can I change “current-url” to something else?
Gregory Bishop, you could probably customize the code shared here to solve the use-case.
Please sign in to leave a comment.