MemberStack.io

Automatic Redirect Issue - duda

duda - automatic redirect for logged in users question

I need help figuring out a way to send users to the members only content page once they’re logged in - so they don’t end up on my homepage, or if they do happen to hit that url they’ll be forwarded to members only content page automatically.

I’ve installed this code in me header and linked it to the appropriate page, but I’m getting an error ‘MemberStack is undefined’ in the chrome inspector

<script>

MemberStack.onReady.then(function(member) {
if (member.loggedIn === true) {
window.location.replace("/member-page")
}
})

Would anyone be able to look at my site?

https://www.cefmembercenter.com/

hey Ian :wave:

Happy to help! Try adding your custom code below the memberstack code. :grinning: You are getting this error because it is trying to run the custom code before it knows what memberstack is. This should fix your problem. :smiley:

memberstack-error

1 Like