MCPcopy
hub / github.com/codeaashu/claude-code / requireAuth

Method requireAuth

src/server/web/auth/token-auth.ts:47–55  ·  view source on GitHub ↗
(req: Request, res: Response, next: NextFunction)

Source from the content-addressed store, hash-verified

45 }
46
47 requireAuth(req: Request, res: Response, next: NextFunction): void {
48 const user = this.authenticate(req as unknown as IncomingMessage);
49 if (!user) {
50 res.status(401).json({ error: "Unauthorized" });
51 return;
52 }
53 (req as AuthenticatedRequest).user = user;
54 next();
55 }
56
57 // ── Internals ─────────────────────────────────────────────────────────────
58

Callers

nothing calls this directly

Calls 3

authenticateMethod · 0.95
nextFunction · 0.85
statusMethod · 0.80

Tested by

no test coverage detected