From 2901570c856c3ce54f94d01c986d493778751ae8 Mon Sep 17 00:00:00 2001 From: jejebecarte <69335633+jejebecarte@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:15:00 +1000 Subject: [PATCH] fix: remove MINECRAFT_PASSWORD minimum length --- src/util/env.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/util/env.ts b/src/util/env.ts index faf548b8..0f1e1174 100644 --- a/src/util/env.ts +++ b/src/util/env.ts @@ -2,8 +2,6 @@ import logger from 'consola'; import { config } from 'dotenv'; import { z } from 'zod'; -config(); - const BOOLEAN_SCHEMA = z .string() .toLowerCase() @@ -12,10 +10,10 @@ const BOOLEAN_SCHEMA = z const SNOWFLAKE_SCHEMA = z.coerce.string().regex(/^\d*$/gm); -// MINECRAFT_PASSWORD field omitted to allow for manual authorization const envSchema = z .object({ MINECRAFT_EMAIL: z.string().email(), + MINECRAFT_PASSWORD: z.string(), // no minimum length allows for manual authorization - dotenv populates an empty string by default HYPIXEL_API_KEY: z.string().min(1), MINECRAFT_CHAT_SEPARATOR: z.string().trim().min(1), USE_PROFANITY_FILTER: BOOLEAN_SCHEMA, @@ -40,6 +38,7 @@ const envSchema = z path: ['REMINDER_MESSAGE'], }); +config(); const env = envSchema.safeParse(process.env); if (!env.success) {