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

Method authenticate

packages/acp-adapter/src/server.ts:564–575  ·  view source on GitHub ↗

* Re-check whether the on-disk token is usable; does NOT trigger an * actual OAuth flow. The stdio JSON-RPC channel has no TTY to render * the device-code prompt — clients are expected to spawn * `kimi login` themselves via the terminal-auth method advertised in * `initialize.authMethods

(params: AuthenticateRequest)

Source from the content-addressed store, hash-verified

562 * (plan G3, lines 68-104).
563 */
564 async authenticate(params: AuthenticateRequest): Promise<AuthenticateResponse | void> {
565 if (params.methodId !== 'login') {
566 throw RequestError.invalidParams(
567 { methodId: params.methodId },
568 `Unknown auth method: ${params.methodId}`,
569 );
570 }
571 if (!(await harnessIsAuthed(this.harness))) {
572 throw RequestError.authRequired();
573 }
574 // void = empty success body (ACP allows AuthenticateResponse | void).
575 }
576
577 async prompt(params: PromptRequest): Promise<PromptResponse> {
578 const acpSession = this.sessions.get(params.sessionId);

Callers 1

auth-gate.test.tsFile · 0.80

Calls 1

harnessIsAuthedFunction · 0.85

Tested by

no test coverage detected