FirebaseExtended / flutterfire_desktop

An early-stage, experimental pure-Dart implementation of Firebase SDKs.
Other
406 stars 58 forks source link

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

Open davidpanic opened 2 years ago

davidpanic commented 2 years ago

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 commented 1 year ago

Hi! Can I take this issue?

pr-Mais commented 1 year ago

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

Shubham-109 commented 1 year ago

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

davidpanic commented 1 year ago

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