Improve handling of token refresh while offline #89200
Labels
authentication
Issues with the Authentication platform
feature-request
Request for new features or functionality
verified
Verification succeeded
Milestone
Issue Type: Bug
Currently, the built in account extension will attempt to refresh the access token before it expires. If it fails, it deletes the stored refresh token and sends a change event to core that no sessions are available.
If the user goes offline after signing in, then refresh will fail due to the lack of connection. (Or in @sbatten's case, changing networks also seems to cause refresh to fail). When this happens, it's confusing to show a badge on the gear to sign in again. One way we could handle this is for the extension to still remove the session that now has an expired token, but keep the refresh token if the error may be temporary, and retry again a bit later. In the sessions change event, the core could test to see if the user is online before updating the UI, and would need to tell the sync service to stop.
@sandy081 Thoughts?
VS Code version: Code - Insiders 1.42.0-insider (c4d53a1, 2020-01-23T05:38:55.065Z)
OS version: Darwin x64 18.7.0
The text was updated successfully, but these errors were encountered: