Skip to content

Commit

Permalink
fix: remove MINECRAFT_PASSWORD minimum length
Browse files Browse the repository at this point in the history
  • Loading branch information
jejebecarte committed Sep 27, 2024
1 parent 40d4c93 commit 2901570
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/util/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import logger from 'consola';
import { config } from 'dotenv';
import { z } from 'zod';

config();

const BOOLEAN_SCHEMA = z
.string()
.toLowerCase()
Expand All @@ -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,
Expand All @@ -40,6 +38,7 @@ const envSchema = z
path: ['REMINDER_MESSAGE'],
});

config();
const env = envSchema.safeParse(process.env);

if (!env.success) {
Expand Down

0 comments on commit 2901570

Please sign in to comment.