Skip to content

Handle additional errors from verifyIdToken #174

Description

@kmjennison

Is your feature request related to a problem? Please describe.

Firebase admin's verifyIdToken may throw some errors that this module should probably handle. See this thread for a background discussion: #125

See a list of Firebase admin auth errors here:
https://firebase.google.com/docs/reference/node/firebase.auth.Error

Currently, we only handle auth/id-token-expired.

Describe the solution you'd like and how you'd implement it

When calling verifyIdToken, this module should probably handle the following errors:

  • auth/invalid-user-token: return an unauthed user
  • auth/user-token-expired: return an unauthed user
  • auth/user-disabled: return an unauthed user
  • auth/argument-error: call to refresh the ID token—however, we need to confirm this will address the kid claim error (see this comment for more info).

Is this a breaking change?
Yes, in the case developers are catching and handling these errors themselves.

Describe alternatives you've considered
Continue to ignore errors and let developers handle them. I can't think of a compelling reason not to handle any of the above errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions