I believe it should be a really simple thing but I keep getting 404 error. Can anyone please help.
$w . onReady ( function (){
$w ( ‘#button1’ ). onClick ( function (){
let email = $w ( ‘#loginEmail’ ). value ;
let password = $w ( ‘#loginPassword’ ). value ;
wixUsers . login ( email , password )
. then (()=>{
wixLocation . to ( ‘/members/{Email}’ );
})
})
})
I see that you are redirecting to:
wixLocation.to('/members/{Email}');
Do you have a members page? Or is it Members?
Typically, you should redirect based on user ID. So, after the user has logged in, it would look something like this:
wixLocation.to(`/Members/${wixUsers.currentUser.id}`);
I did change it to backticks but unfortunately still no luck
I am having the same issue, I am trying to let the onClick function of (my profile) button to take the member to the dynamic profile page. I have used the same code posted above and used the backtick but it seems that it is not responding. I have tried to change the location and the code would work fine for a static page (without the id part)
Is the site member logged in?