MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / logout

Method logout

packages/cloud/src/WebAuthService.ts:364–391  ·  view source on GitHub ↗

* Log out * * This method removes all stored tokens and stops the refresh timer.

()

Source from the content-addressed store, hash-verified

362 * This method removes all stored tokens and stops the refresh timer.
363 */
364 public async logout(): Promise<void> {
365 const oldCredentials = this.credentials
366
367 try {
368 // Clear credentials from storage - onDidChange will handle state transitions
369 await this.clearCredentials()
370 await this.context.globalState.update(AUTH_STATE_KEY, undefined)
371
372 if (oldCredentials) {
373 try {
374 await this.clerkLogout(oldCredentials)
375 } catch (error) {
376 this.log("[auth] Error calling clerkLogout:", error)
377 }
378 }
379
380 const vscode = await importVscode()
381
382 if (vscode) {
383 vscode.window.showInformationMessage("Logged out from Roo Code Cloud")
384 }
385
386 this.log("[auth] Logged out from Roo Code Cloud")
387 } catch (error) {
388 this.log(`[auth] Error logging out from Roo Code Cloud: ${error}`)
389 throw new Error(`Failed to log out from Roo Code Cloud: ${error}`)
390 }
391 }
392
393 public getState(): AuthState {
394 return this.state

Callers

nothing calls this directly

Calls 6

clearCredentialsMethod · 0.95
clerkLogoutMethod · 0.95
importVscodeFunction · 0.85
updateMethod · 0.65
logMethod · 0.65

Tested by

no test coverage detected