Hello, I am building a login lightbox that connects to a dynamic page to display client information that they will be able to read and update. I have my sign-in lightbox and its code, the members’ database, and the dynamic page with the dataset connected to the members’ database. I’ve also enabled custom site registration for the login page.
When I test the login lightbox, all it does is expand the error message, which I do want if there’s an error, but I’m not sure why there is an error and how I can fix this. Am I missing something? Here’s what I have so far. Any help would be amazing.
Also, the event listener is connected to the click event function. This can be seen in the dialog box on the right-hand side of the screen.
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
$w.onReady(function () {
$w('#forgotPassword').onClick( (event) => {
wixUsers.promptForgotPassword()
.then( () => {
})
.catch( (err) => {
let errorMsg = err;
});
});
});
export function loginNow_click_1(event) {
let email = ("#loginEmail").value;
let password = ("#loginPassword").value;
//$w('#loginPassword').inputType = 'password';
wixUsers.login(email, password)
.then( () => {
console.log("User is logged in");
wixLocation.to("/members/update/${wixUsers.currentUser.id}");
})
.catch( (err) => {
console.log(err);
$w("#errorMessage").expand();
});
}