From 46491a14db7e1512c8b1dc396bae6f3debe0e078 Mon Sep 17 00:00:00 2001 From: Sam Olsen Date: Fri, 26 Aug 2022 10:02:09 -0700 Subject: [PATCH 1/5] Update type of ParsedToken to include unknown --- common/api-review/auth.api.md | 2 +- packages/auth/src/model/public_types.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/api-review/auth.api.md b/common/api-review/auth.api.md index 47fc7ec5417..e640dc5e673 100644 --- a/common/api-review/auth.api.md +++ b/common/api-review/auth.api.md @@ -538,7 +538,7 @@ export function parseActionCodeURL(link: string): ActionCodeURL | null; // @public export interface ParsedToken { - [key: string]: string | object | undefined; + [key: string]: string | object | undefined | unknown; 'auth_time'?: string; 'exp'?: string; 'firebase'?: { diff --git a/packages/auth/src/model/public_types.ts b/packages/auth/src/model/public_types.ts index ea6dc857962..1da93758f4f 100644 --- a/packages/auth/src/model/public_types.ts +++ b/packages/auth/src/model/public_types.ts @@ -104,7 +104,7 @@ export interface ParsedToken { 'identities'?: Record; }; /** Map of any additional custom claims. */ - [key: string]: string | object | undefined; + [key: string]: string | object | undefined | unknown; } /** From e9447b04b64a1bf916f296afcedbbabdb17fbe0b Mon Sep 17 00:00:00 2001 From: Sam Olsen Date: Fri, 26 Aug 2022 10:05:39 -0700 Subject: [PATCH 2/5] Make it unknown outright --- common/api-review/auth.api.md | 2 +- packages/auth/src/model/public_types.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/api-review/auth.api.md b/common/api-review/auth.api.md index e640dc5e673..5f0462a2036 100644 --- a/common/api-review/auth.api.md +++ b/common/api-review/auth.api.md @@ -538,7 +538,7 @@ export function parseActionCodeURL(link: string): ActionCodeURL | null; // @public export interface ParsedToken { - [key: string]: string | object | undefined | unknown; + [key: string]: unknown; 'auth_time'?: string; 'exp'?: string; 'firebase'?: { diff --git a/packages/auth/src/model/public_types.ts b/packages/auth/src/model/public_types.ts index 1da93758f4f..e8f818b9a26 100644 --- a/packages/auth/src/model/public_types.ts +++ b/packages/auth/src/model/public_types.ts @@ -104,7 +104,7 @@ export interface ParsedToken { 'identities'?: Record; }; /** Map of any additional custom claims. */ - [key: string]: string | object | undefined | unknown; + [key: string]: unknown; } /** From 97644047cf5c891b6c8bfb02395a8ef741e8db00 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 26 Aug 2022 10:07:52 -0700 Subject: [PATCH 3/5] Changeset --- .changeset/spotty-pillows-applaud.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/spotty-pillows-applaud.md diff --git a/.changeset/spotty-pillows-applaud.md b/.changeset/spotty-pillows-applaud.md new file mode 100644 index 00000000000..05308cf4330 --- /dev/null +++ b/.changeset/spotty-pillows-applaud.md @@ -0,0 +1,5 @@ +--- +"@firebase/auth": patch +--- + +Update custom claim type of `ParsedToken` to be `unknown` From 7010f556e0a675375fd8658e930ff4780d17e302 Mon Sep 17 00:00:00 2001 From: Sam Olsen Date: Wed, 7 Sep 2022 08:52:50 -0700 Subject: [PATCH 4/5] Switch over to any instead --- common/api-review/auth.api.md | 2 +- packages/auth/src/model/public_types.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/api-review/auth.api.md b/common/api-review/auth.api.md index 5f0462a2036..045b64bcf19 100644 --- a/common/api-review/auth.api.md +++ b/common/api-review/auth.api.md @@ -538,7 +538,7 @@ export function parseActionCodeURL(link: string): ActionCodeURL | null; // @public export interface ParsedToken { - [key: string]: unknown; + [key: string]: any; 'auth_time'?: string; 'exp'?: string; 'firebase'?: { diff --git a/packages/auth/src/model/public_types.ts b/packages/auth/src/model/public_types.ts index e8f818b9a26..fdef53e6850 100644 --- a/packages/auth/src/model/public_types.ts +++ b/packages/auth/src/model/public_types.ts @@ -15,6 +15,8 @@ * limitations under the License. */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + import { FirebaseApp } from '@firebase/app'; import { CompleteFn, @@ -104,7 +106,7 @@ export interface ParsedToken { 'identities'?: Record; }; /** Map of any additional custom claims. */ - [key: string]: unknown; + [key: string]: any; } /** From a3ef14c1b26f2b95c46270b5ac5e73828ddbfeab Mon Sep 17 00:00:00 2001 From: Sam Olsen Date: Wed, 7 Sep 2022 09:33:02 -0700 Subject: [PATCH 5/5] Update changelog --- .changeset/spotty-pillows-applaud.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/spotty-pillows-applaud.md b/.changeset/spotty-pillows-applaud.md index 05308cf4330..d951adf1d5c 100644 --- a/.changeset/spotty-pillows-applaud.md +++ b/.changeset/spotty-pillows-applaud.md @@ -2,4 +2,4 @@ "@firebase/auth": patch --- -Update custom claim type of `ParsedToken` to be `unknown` +Update custom claim type of `ParsedToken` to be `any`