MCPcopy Index your code
hub / github.com/codeaashu/claude-code / authenticate

Method authenticate

src/server/web/auth/token-auth.ts:30–41  ·  view source on GitHub ↗
(req: IncomingMessage)

Source from the content-addressed store, hash-verified

28 }
29
30 authenticate(req: IncomingMessage): AuthUser | null {
31 if (!this.token) {
32 return { id: "default", isAdmin: true };
33 }
34 if (this.extractToken(req) === this.token) {
35 return {
36 id: "default",
37 isAdmin: this.adminUsers.size === 0 || this.adminUsers.has("default"),
38 };
39 }
40 return null;
41 }
42
43 setupRoutes(_app: Application): void {
44 // Token auth needs no login/callback/logout routes.

Callers 1

requireAuthMethod · 0.95

Calls 2

extractTokenMethod · 0.95
hasMethod · 0.45

Tested by

no test coverage detected