I’m trying to have my page go from log in to a profile page. When I log in I get an error 404 page an’t be found. Here is my code. I’ve also tried name without the curly brackets? Please help if you can. Thank you in advance.
See Corvid Tutorial: Building Your Own Members Area . I believe that you need to get the current user ID. The code section explains.
You need something like this:
import wixLocation from 'wix-location';
$w.onReady(function(){
$w('#loginNow').onClick(function (){
let email = $w('#loginEmail').value;
let password = $w('#loginPassword').value;
wixUsers.login(email, password)
then(()=>{
wixLocation.to(`/Members/${wixUsers.currentUser.id}`);
})
})
})
Note that a Template Literal is used for the URL, and uses a back-tick ` and not '.