Hi,
I would like create a safe custom log in by:
- User enters email in the email input
- User clicks the “confirm” button
- If email exists; password field shows . But, if email does not exist; error message: “Email does not exist” shows
(I know how to create the custom log in; just confused how to check the email’s existence first)
This is my code, but this does not work; I want the action to take place when the user click the confirm button
export function confirm_click(event) {
let email = $w('#email').value
wixData.query('PrivateMembersData')
.eq('emails', email)
.find()
.then((res) => {
if(res) {
$w('#password').show()
} else {
$w('#errorMessage').show()
})
}
the email field for PrivateMemberdata looks like this:
Field Name: Emails
Field Key: emails
I hope you can help me
Thanks in advance