-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
token returns null when awaited right after initializing #70
Comments
lulupointu
added a commit
to lulupointu/fresh
that referenced
this issue
Feb 14, 2024
…icated) before returning the token This fix allows initial token to be fetched asynchronously. See felangel#70 for a snippet describing the issue
I ran into the same problem yesterday. |
Hey @felangel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code to reproduce:
The
token
method is not waiting for the first read from storage to complete.https://github.com/felangel/fresh/blob/master/packages/fresh/lib/src/fresh.dart#L110 this line can be changed to
await authenticationStatus.firstWhere((status) => status != AuthenticationStatus.initial);
I can put up a PR if you think this fix is appropriate.
The text was updated successfully, but these errors were encountered: