-
Notifications
You must be signed in to change notification settings - Fork 27
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
Refresh Thread bug fixes, add offline support for stateful end user client. #63
Refresh Thread bug fixes, add offline support for stateful end user client. #63
Conversation
Moved refresh logic to another class. Now the thread gets turned on/off automatically per auth state changes. Commit looks noisy than should because of format tweaks, sorry. :/
All of the calls to check for expiration in the current implementation were checking to see if the session had expired.
Also added support for offline mode. This only affects the stateful client non-admin JWT methods (i.e. the stateful end user client). This fixes a problem I was having where the stateful client would simply wipe out the user session if the network wasn't available. I need a user to be able to interact with the app in a mobile environment in which offline/online is a bit less reliable. |
Ok, all set on my end to merge / review /etc. :) |
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.
You're awesome. This is awesome. Thanks so much!
Love the separation of TokenRefresh
into it's own class and the NetworkStatus
helper is very cool. Looking forward to seeing how you're using all this in unity!
What kind of change does this PR introduce?
Fixes some bugs and improves the stability for the background token refresh thread. Simplifies logic for refresh thread. Adds option for maximum wait time. Adds a few test cases.
No meaningful API changes (does add a distinction between invalid session and expired token).