-
Notifications
You must be signed in to change notification settings - Fork 21
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
fix(#80): AuthInterceptor implementation is incomplete #91
fix(#80): AuthInterceptor implementation is incomplete #91
Conversation
…mentation-is-incomplete
@@ -11,9 +12,21 @@ class AuthTokens with _$AuthTokens { | |||
required String refreshToken, | |||
required String tokenType, | |||
required double expiresIn, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, do we ever get this tbh? Shouldn't it just be expiresAt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johsoe in all the projects I've worked on we used expiresIn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we use expiresAt
on other projects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's the case, we should probably remove expiresAt
- we shouldn't have both
…mentation-is-incomplete # pubspec.yaml
Resolves #80
Introduced:
Authenticator
class that is responsible for:ApiAuthInterceptor
, is usingAuthenticator
to reauth if needed.ApiAuthInterceptor
class. It is a rewritten version of the old interceptor — more readable and straightforward. This interceptor is aQueuedInterceptor
now — meaning that, if we await for something, other request calls will wait until this call is resolved.Both of the classes are covered with tests. If you think that not all the scenarios are covered — please let me know, I'll add those.
Also, we now use
FlutterSecureStorage
for storing the tokens. It is safer. BUT! This storage survives app uninstallation IIRC. So we should consider creating something that will detect fresh installation and clear the storage. Something like storing a value with thefreshInstallation
key in the shared prefs of the app.Changes with build context and response errors are related to the freezed generator failing to build with
material
library imports..