Because of my unique login flow, I have to ask users to create a password on a custom password creation page.
I’ve been trying to update the Members and Contacts backend collections with a password unsuccessfully.
Does anyone know if code like this should work? (It’s not working):
export function updateUserPassword( userId, password ){
let userInfo = {
"password": password
};
wixUsers.updateUserFields( userId, userInfo )
.then( () => {
//user has been updated
console.log("user password has been updated in WixUsers");
})
.catch( (err) => {
//there was an error
console.log("error updating user password in WixUsers");
console.log(err);
});
wixCrm.updateContact( userId, userInfo )
.then( () => {
//user has been updated
console.log("user password has been updated in WixCrm");
})
.catch( (err) => {
//there was an error
console.log("error updating user password in WixCrm");
console.log(err);
});
}
I’m calling updateUserPassword from the frontend. My console.log shows the password has been updated for both wixUsers and wixCRM and I get no errors.
But then, I can’t log that user in.
I don’t see any documentation for this and the closest I’ve seen in the forums is this unresolved thread:
Please help… thanks.