This article will show you how to redirect users away from pages they don't need anymore. Usually this is a signup or login page.
Add the following script to the Header or Footer of any page where you want to redirect logged-in members. The script will redirect more quickly if you place it in the header.
You'll want to replace "/"
with something else. Usually a dashboard page or profile page like "/dashboard"
.
<script>
const memberstack = window.$memberstackDom
memberstack.getCurrentMember().then((member) => {
if (member.data) {
window.location.replace("/");
}
})
</script>
Comments
1 comment
Very helpful!! Thank you ✨
Please sign in to leave a comment.