Skip to content

fix(auth): add missing name field to DecodedIdToken#3131

Open
7hokerz wants to merge 1 commit intofirebase:mainfrom
7hokerz:fix/auth-token-field-name
Open

fix(auth): add missing name field to DecodedIdToken#3131
7hokerz wants to merge 1 commit intofirebase:mainfrom
7hokerz:fix/auth-token-field-name

Conversation

@7hokerz
Copy link
Copy Markdown

@7hokerz 7hokerz commented May 7, 2026

The DecodedIdToken returned from the verifySessionCookie or verifyIdToken methods is guaranteed to have an optional name field at runtime, but the field is not present in the type declaration.
Therefore, the name field is recognized as any, requiring unnecessary type guards or casting. This is a PR to resolve this issue.

firebase docs link
In this document, the token has an optional name field.

Changes

  • Add name?: string to DecodedIdToken
  • Add a doc comment for the new field in src/auth/token-verifier.ts
  • Update the generated API surface in etc/firebase-admin.auth.api.md

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds an optional name property to the DecodedIdToken interface in both the API definition and the token verifier source code to represent the user's display name. I have no feedback to provide.

@7hokerz
Copy link
Copy Markdown
Author

7hokerz commented May 7, 2026

@lahirumaramba @jonathanedey , could you please take a look when you have a moment?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant