Skip to content

Update type of ParsedToken to include unknown#6569

Merged
sam-gc merged 5 commits intomasterfrom
sam-gc/claims-type
Sep 7, 2022
Merged

Update type of ParsedToken to include unknown#6569
sam-gc merged 5 commits intomasterfrom
sam-gc/claims-type

Conversation

@sam-gc
Copy link
Copy Markdown
Contributor

@sam-gc sam-gc commented Aug 26, 2022

This change updates the type of the custom claim field in the ParsedToken interface to be any. This more accurately reflects that a JWT may contain any valid JSON object.

While using the unknown type would have been more type-safe (and use of any is generally frowned-upon), it unfortunately makes this change backwards-incompatible.

Fixes #6553

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Aug 26, 2022

🦋 Changeset detected

Latest commit: a3ef14c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/auth Patch
@firebase/auth-compat Patch
firebase Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sam-gc sam-gc requested a review from egilmorez as a code owner August 26, 2022 17:07
@google-oss-bot
Copy link
Copy Markdown
Collaborator

google-oss-bot commented Aug 26, 2022

@sam-gc sam-gc merged commit 666c8ec into master Sep 7, 2022
@sam-gc sam-gc deleted the sam-gc/claims-type branch September 7, 2022 17:13
@google-oss-bot google-oss-bot mentioned this pull request Sep 14, 2022
@firebase firebase locked and limited conversation to collaborators Oct 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParsedToken type does not support allowed value types in Firebase custom claims

7 participants