fix: pr feedback
This commit is contained in:
parent
cf19881d4f
commit
1c3082a980
2 changed files with 12 additions and 1 deletions
|
|
@ -94,6 +94,17 @@ describe("parseConfig", () => {
|
|||
expect(config.appSecret).toBe(fileAppSecret);
|
||||
});
|
||||
|
||||
test("reads APP_SECRET from APP_SECRET_FILE when APP_SECRET is empty", () => {
|
||||
const config = parseConfig(
|
||||
createEnv({
|
||||
APP_SECRET: "",
|
||||
APP_SECRET_FILE: appSecretFixturePath,
|
||||
}),
|
||||
);
|
||||
|
||||
expect(config.appSecret).toBe(fileAppSecret);
|
||||
});
|
||||
|
||||
test("exits when APP_SECRET is missing", () => {
|
||||
expectParseConfigToExit(
|
||||
createEnv({
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ const envSchema = z
|
|||
TRUSTED_ORIGINS: z.string().optional(),
|
||||
TRUST_PROXY: z.string().default("false"),
|
||||
DISABLE_RATE_LIMITING: z.string().default("false"),
|
||||
APP_SECRET: z.string().min(32).max(256).optional(),
|
||||
APP_SECRET: z.preprocess((value) => (value === "" ? undefined : value), z.string().min(32).max(256).optional()),
|
||||
APP_SECRET_FILE: z.string().optional(),
|
||||
BASE_URL: z.string(),
|
||||
ENABLE_DEV_PANEL: z.string().default("false"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue