Validate email and password on custom login page

Hi,
I have a custom login page and need help with code that will display a message to the person logging in if an incorrect email or password is entered.

Can anyone help with this please?

Hi,

Check the wix users api

Basically you need something like this

wixUsers.login(email, password)
  .then( () => {
    console.log("User is logged in");
  } )
  .catch( (err) => {
    console.log(err); //this is where you display your error message
  } );

Thank you!