feat: add flag to disable api rate limit (#3149)

Signed-off-by: aaccardo <hackardo@gmail.com>
This commit is contained in:
Andrea Accardo
2026-06-17 13:26:27 +02:00
committed by GitHub
parent d6de3f830f
commit 3937f7ed2b
5 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ import { createGithubProfileMapper, createProfileMapper } from "./oauth-profile"
import { getTrustedOrigins } from "./trusted-origins";
const authBaseUrl = env.APP_URL;
const isRateLimitEnabled = process.env.NODE_ENV === "production";
const isRateLimitEnabled = process.env.NODE_ENV === "production" && !env.FLAG_DISABLE_API_RATE_LIMIT;
function getOAuthAudiences(): string[] {
const base = authBaseUrl.replace(/\/$/, "");
+1
View File
@@ -74,6 +74,7 @@ export const env = createEnv({
FLAG_DISABLE_SIGNUPS: z.stringbool().default(false),
FLAG_DISABLE_EMAIL_AUTH: z.stringbool().default(false),
FLAG_DISABLE_IMAGE_PROCESSING: z.stringbool().default(false),
FLAG_DISABLE_API_RATE_LIMIT: z.stringbool().default(false),
FLAG_ALLOW_UNSAFE_AI_BASE_URL: z.stringbool().default(false),
FLAG_ALLOW_UNSAFE_OAUTH_REDIRECT_URI: z.stringbool().default(false),