I'm trying to unlink Email to the current user that has a Phone Number and Email already linked to it.
here what I do :
admin.auth().updateUser("user uid", {
email: null,
password: null,
})
.then(function(userRecord) {
// See the UserRecord reference doc for the contents of userRecord.
console.log('Successfully updated user', userRecord.toJSON());
})
.catch(function(error) {
console.log('Error removing email:', error);
});
but it was returning error The email address is improperly formatted.
for some reason, only when I remove the email this happen, when i do the same for phone its working :
admin.auth().updateUser("user uid", {
phoneNumber: null,
})
.then(function(userRecord) {
// See the UserRecord reference doc for the contents of userRecord.
console.log('Successfully updated user', userRecord.toJSON());
})
.catch(function(error) {
console.log('Error removing phone number:', error);
});
The above code works, the phone is removed perfectly. but only when I do this to Email occurring error.
Is there something I miss?