Skip to content

Commit f7db078

Browse files
committed
fix(cas-backend): make /api/status public (no Bearer auth required)
1 parent f1707bc commit f7db078

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/cas/backend/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ await app.register(cors, {
3030
});
3131

3232
// ── Auth hook ──────────────────────────────────────────────────────────────
33-
// All /api/* routes require a Bearer token matching CAS_API_KEY.
33+
// Public routes (no auth required): /health, /api/status
34+
// All other /api/* routes require a Bearer token matching CAS_API_KEY.
35+
const PUBLIC_PATHS = new Set(['/health', '/api/status']);
36+
3437
app.addHook('onRequest', async (request, reply) => {
38+
if (PUBLIC_PATHS.has(request.url)) return;
3539
if (!request.url.startsWith('/api/')) return;
3640
if (!API_KEY) return; // auth disabled when key is not set (dev mode)
3741

0 commit comments

Comments
 (0)