Skip to content

Commit

Permalink
fix: optional hypixel api keys
Browse files Browse the repository at this point in the history
  • Loading branch information
jejebecarte authored Dec 23, 2024
1 parent 46bf26d commit 9a9c27a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/util/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ const BOOLEAN_SCHEMA = z

const SNOWFLAKE_SCHEMA = z.coerce.string().regex(/^\d*$/gm);

// * By default, dotenv populates missing values with empty strings - minimum length should not be used for optional fields
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).optional(),
MINECRAFT_PASSWORD: z.string(), // no minimum length allows for manual authorization
HYPIXEL_API_KEY: z.string(),
MINECRAFT_CHAT_SEPARATOR: z.string().trim().min(1),
USE_PROFANITY_FILTER: BOOLEAN_SCHEMA,
USE_FIRST_WORD_OF_AUTHOR_NAME: BOOLEAN_SCHEMA,
Expand Down

0 comments on commit 9a9c27a

Please sign in to comment.