-
Notifications
You must be signed in to change notification settings - Fork 30
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
Improve Studio Token Authentication URI Handler #5049
Conversation
window.registerUriHandler({ | ||
handleUri(uri: Uri): ProviderResult<void> { | ||
if (uri.path.startsWith(path)) { | ||
if (uri.path === path) { |
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.
Studio is now decoding the query redirect_uri before redirecting so we can use the equals check.
void waitForUriResponse('/studio-complete-auth', () => { | ||
void this.requestStudioToken(deviceCode, tokenUri) | ||
}) | ||
this.studioAccessTokenUriHandler = waitForUriResponse( |
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.
Realized we aren't disposing the uri handler after use. I updated the code to dispose of the listener if:
- we get a response from Studio
- the user wants to try authentication from the start again
Code Climate has analyzed commit 8a403a8 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (85% is the threshold). This pull request will bring the total coverage in the repository to 95.3% (0.0% change). View more on Code Climate. |
Details are inline.
Related to #3864