feat: simplify environment configuration by hardcoding token TTLs and removing unnecessary variables

This commit is contained in:
Daniel Volz
2025-12-25 14:54:38 +01:00
parent 09bd7dc34a
commit 5900fddb2d
6 changed files with 7 additions and 14 deletions
+1 -4
View File
@@ -4,16 +4,13 @@ import dotenv from "dotenv";
dotenv.config({ path: process.env.DOTENV_PATH || ".env" });
const EnvSchema = z.object({
NODE_ENV: z.enum(["development", "production", "test"]).default("development"),
NODE_ENV: z.enum(["development", "production", "test"]).default("production"),
PORT: z.string().transform((v) => parseInt(v, 10)).default("3000"),
DATABASE_URL: z.string().default("file:./data/medassist-ng.db"),
CORS_ORIGINS: z.string().default("http://localhost:5173,http://localhost:4173"),
LOG_LEVEL: z.string().default("info"),
JWT_SECRET: z.string().min(10),
REFRESH_SECRET: z.string().min(10),
COOKIE_SECRET: z.string().min(10),
ACCESS_TOKEN_TTL_MIN: z.string().default("15"),
REFRESH_TOKEN_TTL_DAYS: z.string().default("14"),
});
export type Env = z.infer<typeof EnvSchema>;