From 4f31962b4efa64b482c8471865c202b618b127b2 Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Mon, 21 Jul 2025 12:27:05 -0700 Subject: [PATCH] fix: proper isProd check in auth (#457) --- apps/open-swe/src/security/auth.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/open-swe/src/security/auth.ts b/apps/open-swe/src/security/auth.ts index 58ba9adf..7472c59f 100644 --- a/apps/open-swe/src/security/auth.ts +++ b/apps/open-swe/src/security/auth.ts @@ -88,9 +88,9 @@ function isRunReq(reqUrl: string): boolean { export const auth = new Auth() .authenticate(async (request: Request) => { - const isProdEnv = process.env.NODE_ENV === "production"; + const isProd = process.env.NODE_ENV === "production"; // Disable all requests to the server in prod for now. - if (!isProdEnv) { + if (isProd) { return new HTTPException(504, { message: "Open SWE temporarily disabled.", }) as any; @@ -108,8 +108,6 @@ export const auth = new Auth() }; } - const isProd = process.env.NODE_ENV === "production"; - const ghSecretHashHeader = request.headers.get("X-Hub-Signature-256"); if (ghSecretHashHeader) { // This will either return a valid user, or throw an error