diff --git a/packages/cloud/src/AuthService.ts b/packages/cloud/src/AuthService.ts index 06ac754f09..13a6b1c98c 100644 --- a/packages/cloud/src/AuthService.ts +++ b/packages/cloud/src/AuthService.ts @@ -93,8 +93,9 @@ export class AuthService extends EventEmitter { // Generate a cryptographically random state parameter. const state = crypto.randomBytes(16).toString("hex") await this.context.globalState.update(AUTH_STATE_KEY, state) - const uri = vscode.Uri.parse(`${getRooCodeApiUrl()}/extension/sign-in?state=${state}`) - await vscode.env.openExternal(uri) + const params = new URLSearchParams({ state, uri_scheme: vscode.env.uriScheme }) + const url = `${getRooCodeApiUrl()}/extension/sign-in?${params.toString()}` + await vscode.env.openExternal(vscode.Uri.parse(url)) } catch (error) { console.error(`[auth] Error initiating Roo Code Cloud auth: ${error}`) throw new Error(`Failed to initiate Roo Code Cloud authentication: ${error}`)