Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: maintaince mode enable machine identity login and renew

=a58d6ebdace3
diff --git a/backend/src/server/plugins/maintenanceMode.ts b/backend/src/server/plugins/maintenanceMode.ts
index f40f1ff6dc..201dd05b8d 100644
--- a/backend/src/server/plugins/maintenanceMode.ts
+++ b/backend/src/server/plugins/maintenanceMode.ts
@@ -5,8 +5,13 @@ import { getConfig } from "@app/lib/config/env";
export const maintenanceMode = fp(async (fastify) => {
fastify.addHook("onRequest", async (req) => {
const serverEnvs = getConfig();
- if (req.url !== "/api/v1/auth/checkAuth" && req.method !== "GET" && serverEnvs.MAINTENANCE_MODE) {
- throw new Error("Infisical is in maintenance mode. Please try again later.");
+ if (serverEnvs.MAINTENANCE_MODE) {
+ // skip if its universal auth login or renew
+ if (req.url === "/api/v1/auth/universal-auth/login" && req.method === "POST") return;
+ if (req.url === "/api/v1/auth/token/renew" && req.method === "POST") return;
+ if (req.url !== "/api/v1/auth/checkAuth" && req.method !== "GET") {
+ throw new Error("Infisical is in maintenance mode. Please try again later.");
+ }
}
});
});