fix: enforce fake_otp variable to be false while in production

This commit is contained in:
SepehrYahyaee
2026-10-19 11:11:05 +03:30
parent 887b514983
commit e414a97c92
4 changed files with 21 additions and 1 deletions
+9
View File
@@ -14,6 +14,15 @@ export function validate(config: Record<string, unknown>) {
throw new Error("AI_DAMAGE_URL is required when AI_DAMAGE_ENABLED=true");
}
if (
validatedConfig.NODE_ENV === "production" &&
String(validatedConfig.FAKE_OTP ?? "").toLowerCase() === "true"
) {
throw new Error(
"FAKE_OTP must be disabled in production so login codes are delivered by the configured SMS provider",
);
}
const errors = validateSync(validatedConfig, {
skipMissingProperties: false,
});