I'm using this article: https://cloud.google.com/identity-platform/docs/admin/manage-mfa-users
I added code snippet for update and create user.
In both cases I get error:
Object literal may only specify known properties, and 'phoneNumber' does not exist in type 'UpdateMultiFactorInfoRequest'.
I checked in code and enrolled factors is UpdateMultiFactorInfoRequest type. And this interface doesn't have any phoneNumber.
However, there is UpdatePhoneMultiFactorInfoRequest interface, that extends previous one. And this interface has phoneNumber.
This is my piece of code:
admin.auth().updateUser('123456789', {
multiFactor: {
enrolledFactors: [
{
// uid will be auto-generated.
phoneNumber: '+16505550003', //here is an error
displayName: 'Spouse\'s phone',
factorId: 'phone',
}
],
},
})
.then((userRecord) => {
console.log(userRecord.multiFactor.enrolledFactors);
})
.catch((error) => {
console.log(error);
})
Does someone did it? Maybe I'm doing some wrong?
But I just copied snippet from docs.