How to redirect users back to their original CMS page after signup when using Memberstack authentication? Answered

Post author
Marius

Do you know how to do this?

My objective: I'm trying to redirect a user to a specific URL after he signs up. However, the URL comes from a dynamic Webflow CMS collections.

How can I achieve this (example):

  • I'm the user. I'm going on mixsave.org. I click on a deal, (for this example let's say it's a discount to Memberstack) from a collection of deals. I get redirected to /integrations/memberstack (the URL that comes from the CMS).
  • BUT. I won't even see the /integrations/memberstack page. I will instantly get redirected to a /signup page, since, i have set it up in memberstack, that only signed up users can see the /integrations/* (folder)
  • Now I'm on the /signup page. I signup, then I get sent to /home.
  • BUT. I'm not trying to send the user to /home.

What I'm trying to do is this:
After signup, send the user to /integrations/memberstack (which is the first url he clicked on to begin with).

What are your guys thoughts? How to achieve this?

-- Set the url he clicked on in cookies? Some js will be required for this perhaps?

Comments

3 comments

  • Comment author
    Manuel Ogomigo

    Okay here's how you can do this using local storage and memberstack.

    When a user go to a page, save that page in local storage.

    When they sign up, you can save the creation date in memberjson.

    And after they sign up, use memebrstack DOM to check if there are newly sign up users, if yes redirect them to the local storage page.

    And maybe after that you can clear the json and local storage if you want or just set the code to run one time based on the creation date.

    I hope this helps.

    You could also ask Rey for help regarding the memberstack DOM, or reach out 😁🙏

    0
  • Comment author
    A J

    Hey Marius, you could explore this via referring to this template that Memberstack has.

    Linking it here for your reference:
    https://webflow.com/made-in-webflow/website/redirect-to-attempted-page

    So with few tweaks, you can redirect users to the gated page they were trying to access before signup/login page was loaded.

    Video explanation by Julian Galluzzo:
    https://www.loom.com/share/85d3b20657e4455897eec172bce05f19?t=210

    0
  • Comment author
    Marius

    thank you so much

    0

Please sign in to leave a comment.