Skip to content

Commit fa2a4da

Browse files
fix(auth): Defines missing DecodedIdToken types. (#852)
* Defines missing `DecodedIdToken` types. Fixes #846
1 parent f8229c6 commit fa2a4da

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/auth.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,17 @@ export namespace admin.auth {
420420
*/
421421
auth_time: number;
422422

423+
/**
424+
* The email of the user to whom the ID token belongs, if available.
425+
*/
426+
email?: string;
427+
428+
/**
429+
* Whether or not the email of the user to whom the ID token belongs is
430+
* verified, provided the user has an email.
431+
*/
432+
email_verified?: boolean;
433+
423434
/**
424435
* The ID token's expiration time, in seconds since the Unix epoch. That is, the
425436
* time at which this ID token expires and should no longer be considered valid.
@@ -494,6 +505,16 @@ export namespace admin.auth {
494505
*/
495506
iss: string;
496507

508+
/**
509+
* The phone number of the user to whom the ID token belongs, if available.
510+
*/
511+
phone_number?: string;
512+
513+
/**
514+
* The photo URL for the user to whom the ID token belongs, if available.
515+
*/
516+
picture?: string;
517+
497518
/**
498519
* The `uid` corresponding to the user who the ID token belonged to.
499520
*

src/auth/auth.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export interface ListUsersResult {
6464
export interface DecodedIdToken {
6565
aud: string;
6666
auth_time: number;
67+
email?: string;
68+
email_verified?: boolean;
6769
exp: number;
6870
firebase: {
6971
identities: {
@@ -76,6 +78,8 @@ export interface DecodedIdToken {
7678
};
7779
iat: number;
7880
iss: string;
81+
phone_number?: string;
82+
picture?: string;
7983
sub: string;
8084
tenant?: string;
8185
[key: string]: any;

0 commit comments

Comments
 (0)