Can't create user with `phoneNumber: null`
See original GitHub issueDescribe your environment
- Operating System version: macOS Monterey 12.0.1
- Firebase SDK version: 9.10.0
- Firebase Product: auth
- Node.js version: 12.22.3
- NPM version: 6.14.13
Describe the problem
I receive the following error when creating a user with phoneNumber: null
:
FirebaseAuthError: The phone number must be a non-empty E.164 standard compliant identifier string.
But the function params say it should be allowed:
Steps to reproduce:
Run the code below.
Relevant Code:
import firebase from 'firebase-admin'
await firebase.auth().createUser({
displayName: 'John',
email: 'john@example.com',
phoneNumber: null,
})
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
firebase phone number authentication getting null reference
I am trying to run my application on the physical device when I try to login using the phone number and received an...
Read more >Manage Users | Firebase Authentication - Google
Set to null to clear the user's existing phone number. password, string, The user's new raw, unhashed password. Must be at least six...
Read more >Blank, Coalesce, IsBlank, and IsEmpty functions in Power ...
Tests whether a value is blank or a table contains no records, and provides a way to create blank values.
Read more >User pool attributes - Amazon Cognito
Attributes are pieces of information that help you identify individual users, such as name, email address, and phone number. A new user pool...
Read more >User management - Firebase Admin SDK for PHP
You can also filter by email, phone number or uid: ... When a user doesn't exist, no exception is thrown, but its entry...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think it makes any sense to “create” a user with a null phone number. It’s same as creating one with no phone number specified. In case of update it specifically means to remove the phone number from the account.
@hiranya911 For example, there’s nothing wrong with:
In fact, that’s sometimes even necessary if you need to filter on
phoneNumber
— if the property is just omitted, it won’t be indexed.If
null
makes sense when adding a user to Firestore, intuitively, it also makes sense for Firebase Auth. I understand those are two different services with different implementations, but I’m talking from the perspective of someone who’s looking from the outside, consuming them.