diff --git a/extensions/vscode/src/activation/auth.ts b/extensions/vscode/src/activation/auth.ts deleted file mode 100644 index f90985d96..000000000 --- a/extensions/vscode/src/activation/auth.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { v4 as uuidv4 } from "uuid"; -import * as vscode from "vscode"; - -export async function setupAuth() { - const session = await vscode.authentication.getSession("github", [], { - createIfNone: true, - }); - return session; -} - -export class ManualTokenAuthProvider implements vscode.AuthenticationProvider { - constructor( - public onDidChangeSessions: vscode.Event, - private readonly context: vscode.ExtensionContext, - ) {} - - getSessions( - scopes?: readonly string[] | undefined, - ): Thenable { - const sessions = this.context.globalState.get< - vscode.AuthenticationSession[] - >("continue.manualTokenSessions"); - return Promise.resolve( - sessions?.filter((session) => { - if (!scopes) { - return true; - } - return !scopes.some((scope) => session.scopes.indexOf(scope) === -1); - }) ?? [], - ); - } - async createSession( - scopes: readonly string[], - ): Promise { - const token = await vscode.window.showInputBox({ - prompt: "Enter your Continue user token", - ignoreFocusOut: true, - }); - - if (!token) { - throw new Error("User canceled"); - } - - const session: vscode.AuthenticationSession = { - id: uuidv4(), - accessToken: token, - account: { - id: token, - label: token, - }, - scopes: [], - }; - return session; - } - removeSession(sessionId: string): Thenable { - return this.context.globalState.update( - "continue.manualTokenSessions", - (sessions: vscode.AuthenticationSession[] | undefined) => - sessions?.filter((session) => session.id !== sessionId), - ); - } -} diff --git a/extensions/vscode/src/extension/vscodeExtension.ts b/extensions/vscode/src/extension/vscodeExtension.ts index 0ad3827bd..b89b30e5a 100644 --- a/extensions/vscode/src/extension/vscodeExtension.ts +++ b/extensions/vscode/src/extension/vscodeExtension.ts @@ -17,7 +17,6 @@ import { VerticalPerLineDiffManager } from "../diff/verticalPerLine/manager"; import { VsCodeIde } from "../ideProtocol"; import { registerAllCodeLensProviders } from "../lang-server/codeLens"; import { setupRemoteConfigSync } from "../stubs/activation"; -import { getUserToken } from "../stubs/auth"; import { TabAutocompleteModel } from "../util/loadAutocompleteModel"; import type { VsCodeWebviewProtocol } from "../webviewProtocol"; import { VsCodeMessenger } from "./VsCodeMessenger"; @@ -117,16 +116,6 @@ export class VsCodeExtension { // Indexing + pause token this.diffManager.webviewProtocol = this.webviewProtocol; - if ( - !( - remoteConfigServerUrl === null || - remoteConfigServerUrl === undefined || - remoteConfigServerUrl.trim() === "" - ) - ) { - getUserToken().then((token) => {}); - } - // CodeLens const verticalDiffCodeLens = registerAllCodeLensProviders( context,