Redirect a user to a user-specific dashboard Answered
Good afternoon everyone! New user to Memberstack here. I am currently in the process of integrating Memberstack to my Webflow site, but have a slight issue.
I would like to have 2 separate 'home' pages - one for users logged in, and one for users who are not logged in. Is there any way to completely restrict access to the 'regular' home page for logged in users? I would like the users who are logged in to only have access to the 'logged in' home page. I am currently worried about if a user is logged in, closes the page, then revisits the website later only to be on the 'regular' home page even though their browser has saved their login credentials and they are logged in.
Comments
6 comments
Hey Zane Shake, I believe if you want to redirect logged in users to a dedicated home page, even if they try to access the regular one, this should solve your issue:
https://docs.memberstack.com/hc/en-us/articles/13156905423899--Code-Redirect-Logged-in-Members
Awesome, thank you! That is so helpful. Using that code, is there a way to retrieve the user's name or ID (or any unique identifier about the user), and then redirect them to that user's particular dashboard page?
Something like this? I wrote some pseudocode, don't know how easy it is to understand
I think if you are looking for basic functionality where a user should be redirected to a user-specific dashboard when they login to the site, you can very well use login redirects feature via Memberstack dashboard, like seen in the image. The only thing you need to do is make sure, you fill the unique login redirects for each user when you process the sign-up. Let me know if you are looking for something more specific.
I have unique webpages set up for each user. Just want to redirect them to their particular page
Awesome thanks! That is really close to what I'm looking for. I will make sure to enable that. My question was just about redirecting them to their unique page even after they have logged in.
Okay in that case I am sharing a slightly modified code for your specific homepage use-case, so try it out and let me know if it works. Set your login redirects as shown above and probably add this code before the closing body tag in your regular homepage settings.
THAT WORKED!!!! thank you so much A J you are a lifesaver
Please sign in to leave a comment.