Hello! I have created a login page that has only two fields: username and password. When a user hits the login button, the code analyzes whether the user exists in a collection I named USERS and if the username exists, then it queries for the password to the same collection. I am not using neither wixCRM, nor wixUsers API’s. Here is the code:
wixData.query(“USERS”).eq(“correo_e”, userCorreoElectronico).find().then((results) => {
resultCount = results.totalCount;
if (resultCount) { // The user is in the collection USERS
userType = results.items[0].tipo;
userID = results.items[0]._id;
userSecuenciaCaracteresDB = results.items[0].secuencia_caracteres;
// Verify the password
if (passwordDB === userPassword) {
// valid user
} **else** { // Wrong password.
$w("#textErrors").show();
$w("#textErrors").text = "Usuario o contraseña incorrectos.";
}
} else { // El usuario no está en la base de datos.
$w(“#textErrors”).show();
$w(“#textErrors”).text = “Usuario o contraseña incorrectos.”;
}
})
. catch ((err) => {
let errorMsg = err;
});
Attached is a screen shot of the login page I’ve created.
The issue is that when the user hits the “Begin Sesion/Iniciar Sesión” button, Wix launches the login page of the Wix Members Login. Here is the screenshot:
Technically, my login page is a simple form build with a couple of inputText boxes and a submit button to a collection. I don’t know why Wix launched the Wix Login Members page.
Your help is most welcome!
Thank you!
Marco