Pass editor deeplink URI to app.roocode.com (#4120)

This commit is contained in:
Chris Estreich 2025-05-29 13:45:06 -07:00 committed by GitHub
parent 8de608a0df
commit b0821b3148
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -93,8 +93,9 @@ export class AuthService extends EventEmitter<AuthServiceEvents> {
// 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}`)