Hi,
I am building a members area on my site that has a working custom sign-up/register and a login lightbox. I know they are working because the sign-up lightbox creates a new member in the site members collection. When trying to log in to that registered account to just go to the account page that comes with the Wix members area, it doesn’t do anything. I just get an error in the console that says …
Uncaught (in promise) Error: did not find the pageId for the requested url /members/account/my-account/005900b3-b3bc-47d0-8ee7-b2bd91e6c8d2
at bootstrap-features.fd7de59f.chunk.min.js:1
at www.uptalent.io/:105
at Object.next (www.uptalent.io/:105)
at www.uptalent.io/:105
at new Promise ()
at i (www.uptalent.io/:105)
at Object.handle (bootstrap-features.fd7de59f.chunk.min.js:1)
at bootstrap-features.fd7de59f.chunk.min.js:1
at www.uptalent.io/:105
at Object.next (www.uptalent.io/:105)
So obviously it cannot find the page that I have the URL set to. I followed a tutorial that’s linked below that uses a members area and I’m following the URL format they are using which is wixLocation.to (/Members/${ [wixUsers.currentUser.id](http://wixusers.currentuser.id/) }
); but it doesn’t seem to work.
Any suggestions on how I could navigate to the member’s account page with custom login/sign-up lightboxes would be great. I’ve looked through and tried so many tutorials at this point and nothing has worked.
I’ll post my code below.
My login
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
//for query
import wixData from 'wix-data';
$w.onReady(function () {
let email = ("#loginEmail").value;
let password = ("#loginPassword").value;
$w('#forgotPassword').onClick( (event) => {
wixUsers.promptForgotPassword()
.then( () => {
})
.catch( (err) => {
let errorMsg = err;
});
});
});
export function loginNow_onClick_1(event) {
let password = $w("#loginPassword").value;
let email = $w('#loginEmail').value;
console.log('attempting login');
wixUsers.login(email, password)
.then( () => {
console.log("User is logged in x");
let userId = wixUsers.currentUser.id;
console.log(userId);
wixLocation.to(`/Members/account/my-account/${wixUsers.currentUser.id}`);
})
.catch( (err) => {
console.log('caught login error');
console.log(err);
$w("#errorMessage").expand();
});
console.log('pass');
}
My register code
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
$w.onReady(function(){
$w('#createAccount').onClick(function (){
let phone = $w('#phoneNumber').value;
let isRequired = $w('#agreeToTerms').required = true;
if($w('#agreeToTerms').checked) {
wixUsers.register($w('#email').value, $w('#password').value, {
contactInfo: {
"firstName": $w('#firstName').value,
"lastName": $w('#lastName').value,
'phones' : [phone],
'Company Name' : $w('#companyName').value
}
})
.then(()=>{
//send to member profile
wixLocation.to(`/Members/account/my-account/${wixUsers.currentUser.id}`);
})
console.log('User is registered');
}
})
});