Question:
We have requirement to do Login and SignUp based on Employee Code, in this I have created local Dataset for this signup and login, in which by putting empcode it will get its corresponding email and do the signup as shown below.
In this the password input is given and Wix internally stores this password.
I am storing this password in my dataset as well but during forgot password I am unable to capture the new password changed by the Employee.
Could you please help me to get this password field and could store internaly in dataset
$w(‘#dataset4’).setFilter(wixData.filter().eq(“empCode”,$w(‘#input6’).value)) .then(()=> {
if( $w(“#dataset4”).getTotalCount()>0)
{
let EmpCode = $w(‘#dataset4’).getCurrentItem().EmpCode;
let EmpPhone= $w(‘#dataset4’).getCurrentItem().EPhone;
$w(‘#Phone’).value =EmpPhone;
let email = $w(‘#input7’).value;
let options = {
contactInfo: {
“firstName”: $w(‘#input4’).value,
“email”: $w(‘#input7’).value,
“EmpCode”: Number($w(‘#input6’).value),
“phone”: $w(‘#Phone’).value,
“password”:$w(‘#input8’).value },
privacyStatus: ‘PUBLIC’ }
You will have two password field in your collection one for updated one, one for Wix Members APIs. But you need to create custom password reset page to be able to use this system.
When someone signup into your system you will save the password in both fields but wixPassword will never change. You will use regular password field when you are checking the form inputs.
If user entered password and password in the collection matches you will use wixPassword to login with Wix Members APIs.
In this case I also recommend you to use backend in your system so it will be secure.
But as I said you can’t use Wix generated password reset screen. You need to create your own which shouldn’t be very hard. If it’s not possible for you to do then this system will not work because you can’t track changed password.
Thank you very much for your response. If i make custom password reset form, I could able to save the changes in my local dataset , but wont be able to do changes in wix sytem and hence authentication.login (email,pwd) will fail
since the local pwd and newly changed pwd will be different, My objective is to change password in both i.e. in wix and in local dataset., any help will be appreciated.
You don’t need to change the password at both. You will use the latest password to verify user and use the wixPassword to login user using Member APIs.
But as I said in login form you have you will check the entered password with the user-set custom password. Just double check the system I draw above. (I use that system and it works fine)