I have a code that allows the user to log in, but something strange happens ...
The exact same code on one site makes me log in immediately but on the other it requires me to verify the email, but it shouldn't happen.
The code is this:
export function btnSignUp_click(event) {
$w('#btnSignUp').disable();
let email = $w('#iptEmail').value;
let emails = [];
emails.push(email);
let password = $w('#iptPassword').value;
let name = $w('#iptName').value;
let surname = $w('#iptLastName').value;
wixUsers.register(email, password, {
'contactInfo': {
'firstName': name,
'lastName': surname,
'emails': emails
}
}).then((results) => {
//update database
let toInsert = {
'_id': wixUsers.currentUser.id,
'emailAddress': email,
'peopleId': Math.random().toString(36).substr(2, 4) + Math.round(Date.now() / 1000 / 60 / 60).toString(),
'firstName': name,
'lastName': surname
}
wixData.insert('People', toInsert)
.then(() => {
$w('#txtMessage').text = 'Sing in completed successfully, you will be now redirected';
$w('#txtMessage').show();
setTimeout(wixWindow.lightbox.close('logInSignUp'), 2000);
}).catch((err) => {
$w('#txtMessage').text = 'An error has occurred, try again later';
$w('#txtMessage').show();
$w('#btnSignUp').enable();
console.log(err);
})
});
}
what's the problem?