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

🐛 [firebase_auth] type 'DateTime' is not a subtype of type 'int' when trying to read IdTokenResult.expirationTime #107

Open
davidpanic opened this issue Aug 18, 2022 · 4 comments

Comments

@davidpanic
Copy link

Bug report

Describe the bug
The below error gets thrown when trying to read the IdTokenResult expiration time. I believe that this is due to this line, where you should provide a unix timestamp in the form of an int instead of a DateTime object. This occurs on flutter linux and flutter windows

Steps to reproduce

Steps to reproduce the behavior:

  1. Use the sample code below

Expected behavior

Expected to get the actual token expiration time.

Sample code

final user = await _fbAuth.signInWithEmailAndPassword(email: email, password: password);
IdTokenResult tokenResult = await user.getIdTokenResult();
print(tokenResult.expirationTime); // Error

Additional context

Stack trace:

type 'DateTime' is not a subtype of type 'int'
  File "id_token_result.dart", line 38, col 50, in IdTokenResult.expirationTime

Package versions:

  firebase_core: ^1.20.1
  firebase_auth: ^3.6.3
  firebase_messaging: ^12.0.2
  firebase_core_desktop: ^1.0.2
  firebase_auth_desktop: ^1.0.2

My current workaround for this is to parse the JWT myself from IdTokenResult.token and read the exp field.


@alfredobs97
Copy link

Hi! Can I take this issue?

@pr-Mais
Copy link
Contributor

pr-Mais commented Oct 10, 2022

@alfredobs97 sure! please feel free to submit a PR and ping me

@Shubham-109
Copy link

Hi there, can you please assign this issue to me ?

@davidpanic
Copy link
Author

I guess this project has been abandoned? This is still an issue. Are there any plans on a fix?

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

No branches or pull requests

5 participants