Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VerifyIdToken Error: Null check operator used on a null value #68

Open
rayliverified opened this issue Jan 3, 2025 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@rayliverified
Copy link

Describe the bug
verifyIdToken throw an error if the token's sign_in_provider is null.

Null check operator used on a null value
#0      new DecodedIdToken.fromMap (package:dart_firebase_admin/src/auth/token_verifier.dart:318:48)

This is the culprit.

Line 318: signInProvider: map['sign_in_provider']! as String,

sign_in_provider can be null and is null when returned by the client's FirebaseAuth.instance.currentUser.getIdToken().

To Reproduce

  1. Get a token with FirebaseAuth.instance.currentUser.getIdToken().
  2. Call verifyIdToken with the token.

Expected behavior
verifyIdToken should decode successfully.

@rayliverified rayliverified added the bug Something isn't working label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants