hi i am having some issue displaying a error massage when the client logs in. in the wrong information it should show them an error massage but the error massage is not displaying on my website for some reason i really don’t know why this keeps happening i think i enter the codes wrong i really needed some help on it here is screenshot of it.
so once i entered the wrong information and i click login now it should display an error massage after typing the wrong information but the error massage is not displaying on my light box ? i hope someone can solved this problem here are my codes. my codes is at the bottom
here is my codes
import wixUsers from ‘wix-users’ ;
import wixLocation from ‘wix-location’ ;
import wixWindow from ‘wix-window’ ;
$w.onReady( function (){
$w( ‘#loginNow’ ).onClick( function (){
let email = $w( ‘#loginEmail’ ).value;
let password = $w( ‘#loginPassword’ ).value;
wixUsers.login(email,password)
.then(()=>{
wixLocation.to( ‘/my-account’ );
})
})
})
$w.onReady( function () {
$w( “#forgotPassword” ).onClick( (event) => {
//wixWindow.lightbox.close()
wixUsers.promptForgotPassword()
.then( ( ) => {
//
} )
. catch ( (err) => {
let errorMsg = err; //“The user closed the forgot password dialog”
});
});
});
export function loginButton_click(event) {
let email = $w( “#loginEmail” ).value;
let password = $w( “#loginPassword” ).value;
wixUsers.login(email, password)
.then( () => {
console.log( "User is logged in" );
wixLocation.to( '/my-account' ); //Change the URL ending to whatever page you want to send the user to after they log in.
} )
. catch ( (err) => {
$w( “#errorMessage” ).expand(); // You can delete this line if you are not going to add an error message. Use a regular text element set to ‘collapse on load’ from the Properties Panel.
console.log(err);
} );
}