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

Improve Studio Token Authentication URI Handler #5049

Merged
merged 5 commits into from
Dec 1, 2023

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented Nov 30, 2023

Details are inline.

Related to #3864

window.registerUriHandler({
handleUri(uri: Uri): ProviderResult<void> {
if (uri.path.startsWith(path)) {
if (uri.path === path) {
Copy link
Contributor Author

@julieg18 julieg18 Nov 30, 2023

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(
Copy link
Contributor Author

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

@julieg18 julieg18 marked this pull request as ready for review November 30, 2023 21:27
@julieg18 julieg18 enabled auto-merge (squash) December 1, 2023 14:32
Copy link

codeclimate bot commented Dec 1, 2023

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.

@julieg18 julieg18 merged commit c674f9d into main Dec 1, 2023
@julieg18 julieg18 deleted the studio-token-auth-cleanup branch December 1, 2023 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants