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

Handle session expiration time issue #89. #94

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open

Conversation

fknives
Copy link
Contributor

@fknives fknives commented Sep 7, 2022

This pull request is intends to resolve issue #89.

The main idea is to take advantage of the expires_in response from the server.

Whenever we know the token is already expired, we don't need to send out a request that is certain to fail at least with 401 (if no other network issue is there like DNS, server availability etc).

Without this:
-> tokens are expired
-> request goes out
-> gets 401
-> authenticator refreshes the tokens
-> request is resent with updated tokens
-> data received

With the current changes:
-> tokens are expired
-> expiration timestamp is checked, signaling expiration
-> authenticator refreshes the tokens
-> request is sent with updated tokens
-> data received

For backwards compatibility this is not enabled by default. To take advantage of this a separate TokenExpirationStorage has to be implemented. A combined SharedPref storage for both TokenExpirationStorage and AuthenticationLocalStorage is implemented.

@fknives fknives added the enhancement New feature or request label Sep 7, 2022
@fknives fknives linked an issue Sep 7, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle session expiration time
1 participant