File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import * as vscode from "vscode"
66
77import type { CloudUserInfo } from "@roo-code/types"
88
9- import { getClerkBaseUrl , getRooCodeApiUrl } from "./Config"
9+ import { getClerkBaseUrl , getDeepLinkUrl , getRooCodeApiUrl } from "./Config"
1010import { RefreshTimer } from "./RefreshTimer"
1111
1212export interface AuthServiceEvents {
@@ -93,8 +93,9 @@ export class AuthService extends EventEmitter<AuthServiceEvents> {
9393 // Generate a cryptographically random state parameter.
9494 const state = crypto . randomBytes ( 16 ) . toString ( "hex" )
9595 await this . context . globalState . update ( AUTH_STATE_KEY , state )
96- const uri = vscode . Uri . parse ( `${ getRooCodeApiUrl ( ) } /extension/sign-in?state=${ state } ` )
97- await vscode . env . openExternal ( uri )
96+ const params = new URLSearchParams ( { state, ide : getDeepLinkUrl ( this . context ) } )
97+ const url = `${ getRooCodeApiUrl ( ) } /extension/sign-in?${ params . toString ( ) } `
98+ await vscode . env . openExternal ( vscode . Uri . parse ( url ) )
9899 } catch ( error ) {
99100 console . error ( `[auth] Error initiating Roo Code Cloud auth: ${ error } ` )
100101 throw new Error ( `Failed to initiate Roo Code Cloud authentication: ${ error } ` )
Original file line number Diff line number Diff line change 1+ import * as vscode from "vscode"
2+
13export const getClerkBaseUrl = ( ) => process . env . CLERK_BASE_URL || "https://clerk.roocode.com"
24export const getRooCodeApiUrl = ( ) => process . env . ROO_CODE_API_URL || "https://app.roocode.com"
5+
6+ export const getDeepLinkUrl = ( context : vscode . ExtensionContext ) => {
7+ const ide = vscode . env . appName ?. toLowerCase ( ) ?? "vscode"
8+ const packageJSON = context . extension ?. packageJSON
9+ const publisher = packageJSON ?. publisher ?? "RooVeterinaryInc"
10+ const name = packageJSON ?. name ?? "roo-cline"
11+ return `${ ide } ://${ publisher } .${ name } `
12+ }
You can’t perform that action at this time.
0 commit comments