Skip to content

Commit be19859

Browse files
committed
fix(studio-bridge): make OAuth2 token injection non-fatal during auth
The cookie may be invalidated between credential writes and the OAuth2 CSRF request. Since cookie-based credentials alone are sufficient for the Studio version in the Docker image, treat OAuth2 failure as a warning rather than crashing the entire auth step.
1 parent 487b409 commit be19859

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tools/studio-bridge/src/linux/linux-credential-writer.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,17 @@ export async function injectCredentialsAsync(
172172
// Also write to the Windows Registry path that Studio checks on startup.
173173
await writeRegistryAuthAsync(cookie, userId, env);
174174

175-
// Obtain and inject an OAuth2 refresh token. Studio 0.710+ requires this
175+
// Obtain and inject an OAuth2 refresh token. Studio 0.710+ may require this
176176
// for startup authentication — without it, Studio blocks on a WebView2
177-
// login dialog that doesn't work under Wine.
178-
await injectOAuth2RefreshTokenAsync(cookie, userId, writeCredExe, env);
177+
// login dialog that doesn't work under Wine. Non-fatal: cookie-based
178+
// credentials above are sufficient for many Studio versions.
179+
try {
180+
await injectOAuth2RefreshTokenAsync(cookie, userId, writeCredExe, env);
181+
} catch (error) {
182+
OutputHelper.warn(
183+
`OAuth2 refresh token injection failed (non-fatal): ${error instanceof Error ? error.message : error}`
184+
);
185+
}
179186

180187
OutputHelper.info('Credentials injected into Wine Credential Manager.');
181188
}

0 commit comments

Comments
 (0)