1
votes

How can one create a user with phone number and email as providers in Firebase?

The code presented only sets up the phone number as being the only provider.

enter image description here

admin.auth().createUser({

uid: email,
email: email,
emailVerified: true,
phoneNumber: checkMobileTel(mobileTel)

}) .then(function(userRecord: { uid: any; }) {

// See the UserRecord reference doc for the contents of userRecord.
console.log('Successfully created new user:', userRecord.uid);

}) .catch(function(error: any) {

console.log('Error creating new user:', error);

});

1

1 Answers

1
votes

I think you are forgetting to add the password field. I hope I could help, happy coding!

password string The user's raw, unhashed password. Must be at least six characters long.