MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / logout

Method logout

packages/oauth/src/toolkit.ts:225–239  ·  view source on GitHub ↗
(
    providerName?: string | undefined,
    oauthRef?: KimiOAuthTokenRef | undefined,
  )

Source from the content-addressed store, hash-verified

223 }
224
225 async logout(
226 providerName?: string | undefined,
227 oauthRef?: KimiOAuthTokenRef | undefined,
228 ): Promise<KimiOAuthLogoutResult> {
229 const name = providerName ?? KIMI_CODE_PROVIDER_NAME;
230 const oauthHost = this.oauthHostFor(oauthRef);
231 const oauthKey = oauthRef?.key ?? this.defaultOAuthKey(undefined, oauthHost);
232 await this.managerFor(name, oauthKey, oauthHost).logout();
233 if (this.configAdapter?.remove !== undefined && name === KIMI_CODE_PROVIDER_NAME) {
234 const config = await this.configAdapter.read();
235 this.configAdapter.remove(config);
236 await this.configAdapter.write(config);
237 }
238 return { providerName: name, ok: true };
239 }
240
241 async ensureFresh(
242 providerName?: string | undefined,

Callers 1

mainFunction · 0.95

Calls 7

oauthHostForMethod · 0.95
defaultOAuthKeyMethod · 0.95
managerForMethod · 0.95
logoutMethod · 0.65
readMethod · 0.65
removeMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected