On my site when the user presses login. I want to take them to their own member dashboard.
When I set the member dashboard page URL to (see image below) and attach the following code
I can access a member page.
import wixUsers from 'wix-users';
import wixData from 'wix-data';
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');
})
})
})
What I’m wanting to do is make it to where each user has a unique URL. So I thought by adding the following to the URL and this code snippet everything would work right.
import wixUsers from 'wix-users';
import wixData from 'wix-data';
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/{ID}');
})
})
})
After I do the following above I get a page 404 error
Any Help Would Be Greatly Appreciated