Skip to main content

How to redirect Webflow users back to their pre-login page after successful authentication?

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?

10 comments

  • Julian Galluzzo
    Julian Galluzzo

    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

    0
  • NAMAN PARASHAR
    NAMAN PARASHAR OP

    Hi Julian Galluzzo, thanks for sharing this. We’ll give this a try and let you know if we face any issues.

    0
  • Irmantas Motiejunas
    Irmantas Motiejunas

    any plans for such redirect attribute?

    0
  • Biagio Della Rocca
    Biagio Della Rocca

    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!

    0
  • A J
    A J

    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.

    0
  • Biagio Della Rocca
    Biagio Della Rocca

    This is exactly what I was looking for, thank you very much AJ!

    0
  • Gregory Bishop
    Gregory Bishop

    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?

    0
  • A J
    A J

    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.

    0
  • Gregory Bishop
    Gregory Bishop

    i am using passwordless logins…..using the code send, or google, facebook, and linkedin. Can I change “current-url” to something else?

    0
  • A J
    A J

    Gregory Bishop, you could probably customize the code shared here to solve the use-case.

    0

Please sign in to leave a comment.

Sitemap