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

Function disconnectZooCode

src/services/zoo-code-auth.ts:246–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

244}
245
246export async function disconnectZooCode(): Promise<void> {
247 const token = await getZooCodeToken()
248 if (token) {
249 const baseUrl = getZooCodeBaseUrl()
250
251 try {
252 await fetch(`${baseUrl}/api/extension/auth/revoke`, {
253 method: "POST",
254 headers: { Authorization: `Bearer ${token}` },
255 signal: AbortSignal.timeout(10_000),
256 })
257 } catch {
258 // Ignore errors during revocation
259 }
260 }
261 await clearZooCodeToken()
262 await clearZooCodeUserInfo()
263 vscode.window.showInformationMessage(t("common:zooAuth.info.disconnected"))
264}

Callers 2

webviewMessageHandlerFunction · 0.85

Calls 6

tFunction · 0.90
getZooCodeTokenFunction · 0.85
getZooCodeBaseUrlFunction · 0.85
clearZooCodeTokenFunction · 0.85
clearZooCodeUserInfoFunction · 0.85

Tested by

no test coverage detected