Hi All,
I have been trying to figure out a complete approach to making my custom log in and registrations work flawlessly. I have managed to make them work as intended except for the following:
-
Log In- How are you guys adding a login error message for when the email or password is not correct or doesn’t match?
-
Log In - How are you adding a forgot password prompt? I am using the example from the reference site but i cant get it to work.
-
Registration - How are you adding a duplicate user or “email address already used” error message?
I think I am missing a basic key to making these work?
Here is my current login code, Where and what are you using for the error message and forgot password?
import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;
$w.onReady( function (){
$w(‘#button2’).onClick( function (){
let email = $w(‘#emailinput’).value;
let password = $w(‘#passwordinput’).value;
wixUsers.login(email, password)
.then(()=>{ wixLocation.to(‘/account/member-benefits’);
console.log(“User is logged in”); } )
. catch ( (err) => { console.log(err);
})
})
})
Here is my registration code, Where and what would you add for a duplicate account error?
import wixUsers from ‘wix-users’;
$w.onReady( function () {
$w(‘#button19’).onClick( () => {
// register as member using form data
wixUsers.register($w(‘#email’).value, $w(‘#password’).value, {
“contactInfo”: {
“firstName”: $w(‘#firstName’).value,
“lastName”: $w(‘#lastName’).value,
“emails”: [$w(‘#email’).value],
“phones”: [$w(‘#phone’).value],
“fax”: ($w(‘#fax’).value),
“address”: ($w(‘#address’).value),
“city”: ($w(‘#city’).value),
“zip”: ($w(‘#zip’).value),
“state”: ($w(‘#state’).value),
“title”: ($w(‘#title’).value),
“company”: ($w(‘#company’).value),
“website”: ($w(‘#website’).value),
“founded”: ($w(‘#year’).value),
“employees”: ($w(‘#employees’).value),
“routes”: ($w(‘#routes’).value),
“heard”: ($w(‘#heard’).value)
}
});
});
});
import wixLocation from ‘wix-location’;
$w.onReady( function () {
$w(‘#button19’).onClick( () => {
wixLocation.to(“/plans-pricing”);
})
})
Any help would be greatly appreciated.