Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth.UserRecord is missing 'phoneNumber' field #34

Closed
rjhuijsman opened this issue Jun 1, 2017 · 3 comments
Closed

auth.UserRecord is missing 'phoneNumber' field #34

rjhuijsman opened this issue Jun 1, 2017 · 3 comments
Assignees

Comments

@rjhuijsman
Copy link

  • Operating System version: N/A
  • Firebase SDK version: N/A
  • Library version: 5.0.0
  • Firebase Product: Auth

The Cloud Functions for Firebase SDK uses the Firebase Admin SDK as its source for a TypeScript definition of an auth.UserRecord. The auth.UserRecord currently contains the following fields:

public readonly uid: string;
public readonly email: string;
public readonly emailVerified: boolean;
public readonly displayName: string;
public readonly photoURL: string;
public readonly disabled: boolean;
public readonly metadata: UserMetadata;
public readonly providerData: UserInfo[];

However, when a Cloud Function is invoked for an Auth user creation that uses phone authentication, the UserRecord sent as a JSON object also contains a phoneNumber field:

{
  "metadata": {
    "createdAt": "2017-06-01T23:01:23.000Z",
    "lastSignedInAt": "2017-06-01T23:01:23.000Z"
  },
  "phoneNumber": "+1555123456",
  "providerData": [
    {
      "providerId": "phone",
      "uid": "+1555123456"
    }
  ],
  "uid": "C6simWCCNlO3Mdyq9PYyY1O8qPJ3"
}

This new phoneNumber is currently hard to access for TypeScript users, since it's not yet present in the auth.UserRecord.

We should add the phoneNumber field to the Node.js Admin SDK.

@google-oss-bot
Copy link

Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.

@google-oss-bot
Copy link

Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.

@hiranya911
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants