Skip to content

Conversation

@joehan
Copy link
Contributor

@joehan joehan commented Sep 27, 2024

Description

Previously, getAuthToken never checked expiry, because it was never relevant for short lived commands. Now that VSCode uses this same path, we saw lots of expired auth token issues.

I also added a second line of defense here and get new auth tokens whenever we get a 401 error. This is mostly irrelevant within the CLI (since 401's will generally end the process), but may help VSCE repair itself. With the new validity check, this probably should never be hit.

Scenarios Tested

I was getting 401s when executing queries against prod in VSCE - this fixed that. I also tested out a bunch of CLI commands from various auth states: valid tokens, expired tokens, and using application default credentials

@joehan joehan requested review from hlshen and yuchenshi September 27, 2024 02:50
@joehan joehan merged commit 4c24ff0 into master Sep 27, 2024
@joehan joehan deleted the jh-expired branch September 27, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants