I am using authentication.register to register members to my site.
I run the following function as part of the process:
async function submitReg() {
var email = $w("#email").value;
var password = $w("#password").value;
var first = $w("#firstName").value;
var last = $w("#lastName").value;
authentication.register(email, password, {
contactInfo: {
'firstName': first,
'lastName': last
},
privacyStatus: "PUBLIC"
})
.then((registrationResult) => {
const status = registrationResult.status;
console.log("registrationResult");
console.log(status);
wixWindow.openLightbox("Successful Reg");
})
.catch((err2) => {
if (err2.includes("already exists in collection")) {
$w('#errorMessage').text = "This email address has already been used";
$w('#errorMessage').expand();
$w('#resetPassword').expand();
} else {
wixWindow.openLightbox("Failed Reg");
}
})
}
As you can see, I don’t return from this function…as, if it is successful, then registration is done. However the Successful Reg lightbox never opens…because Wix generates a full-screen lightbox with a message saying the registration is pending admin review. Is there a way to stop Wix from opening that full screen lightbox, so I can control the user experience?
Simon.