diff --git a/src/core/controller/index.ts b/src/core/controller/index.ts index 0e4e0b233e..883e00f94a 100644 --- a/src/core/controller/index.ts +++ b/src/core/controller/index.ts @@ -44,7 +44,6 @@ export class Controller { mcpHub: McpHub accountService: ClineAccountService - authService: AuthService readonly cacheService: CacheService constructor( @@ -56,13 +55,13 @@ export class Controller { HostProvider.get().logToChannel("ClineProvider instantiated") this.accountService = ClineAccountService.getInstance() this.cacheService = new CacheService(context) - this.authService = AuthService.getInstance(this) + const authService = AuthService.getInstance(this) // Initialize cache service asynchronously - critical for extension functionality this.cacheService .initialize() .then(() => { - this.authService.restoreRefreshTokenAndRetrieveAuthInfo() + authService.restoreRefreshTokenAndRetrieveAuthInfo() }) .catch((error) => { console.error("CRITICAL: Failed to initialize CacheService - extension may not function properly:", error) @@ -309,7 +308,7 @@ export class Controller { async handleAuthCallback(customToken: string, provider: string | null = null) { try { - await this.authService.handleAuthCallback(customToken, provider ? provider : "google") + await AuthService.getInstance(this).handleAuthCallback(customToken, provider ? provider : "google") const clineProvider: ApiProvider = "cline" @@ -595,9 +594,7 @@ export class Controller { const terminalReuseEnabled = this.cacheService.getGlobalStateKey("terminalReuseEnabled") const defaultTerminalProfile = this.cacheService.getGlobalStateKey("defaultTerminalProfile") const isNewUser = this.cacheService.getGlobalStateKey("isNewUser") - const welcomeViewCompleted = Boolean( - this.cacheService.getGlobalStateKey("welcomeViewCompleted") || this.authService.getInfo()?.user?.uid, - ) + const welcomeViewCompleted = this.cacheService.getGlobalStateKey("welcomeViewCompleted") const mcpResponsesCollapsed = this.cacheService.getGlobalStateKey("mcpResponsesCollapsed") const terminalOutputLineLimit = this.cacheService.getGlobalStateKey("terminalOutputLineLimit") const localClineRulesToggles = this.cacheService.getWorkspaceStateKey("localClineRulesToggles")