I would like to check the PrivateMembersDatabase first during their sign-in on my CUSTOM sign in. I would like to show an error message if they are not signed up yet. Below is my code on my custom sign-in. Thank you!
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
$w.onReady(function () {
$w("#forgotPassword").onClick( (event) => {
//wixWindow.lightbox.close()
wixUsers.promptForgotPassword()
.then( ( ) => {
//
} )
.catch( (err) => {
let errorMsg = err;
});
});
});
export function loginButton_click(event) {
let email = $w("#email").value;
let password = $w("#password").value;
wixUsers.login(email, password)
.then( () => {
console.log("User is logged in");
wixWindow.lightbox.close();
} )
.catch( (err) => {
console.log(err);
$w("#errorMessage").expand();
} );
}