Merge pull request #3410 from Adityakk9031/#3408

fix: redirect to /auth/initial-setup after hitting auth rate limit (#…
This commit is contained in:
Milo Schwartz
2026-07-29 17:09:40 -04:00
committed by GitHub
2 changed files with 14 additions and 4 deletions
+6 -1
View File
@@ -1397,6 +1397,12 @@ authenticated.put(
// Auth routes
export const authRouter = Router();
unauthenticated.use("/auth", authRouter);
// Register setup-check BEFORE the global auth rate limiter.
// This endpoint is called on every dashboard root page load (pure boolean
// read, no secrets) and must not consume the auth rate-limit budget.
authRouter.get("/initial-setup-complete", auth.initialSetupComplete);
authRouter.use(
rateLimit({
windowMs:
@@ -1701,7 +1707,6 @@ authRouter.post("/idp/:idpId/oidc/generate-url", idp.generateOidcUrl);
authRouter.post("/idp/:idpId/oidc/validate-callback", idp.validateOidcCallback);
authRouter.put("/set-server-admin", auth.setServerAdmin);
authRouter.get("/initial-setup-complete", auth.initialSetupComplete);
authRouter.post("/validate-setup-token", auth.validateSetupToken);
// Security Key routes