Add detailed error messages for missing environment variables

The commit adds detailed error messages for missing environment variables across different configuration files. It updates the zod schema validations in different files, such as feature-flags.config.ts, personal-accounts-server-actions.ts, and others to provide more informative error messages when environment variables are not provided.
This commit is contained in:
giancarlo
2024-04-14 18:50:09 +08:00
parent 81f1bbca3b
commit a549d2d08f
7 changed files with 82 additions and 46 deletions

View File

@@ -5,6 +5,7 @@ import { DatabaseWebhookHandlerService } from '@kit/database-webhooks';
const webhooksSecret = z
.string({
description: `The secret used to verify the webhook signature`,
required_error: `Provide the variable SUPABASE_DB_WEBHOOK_SECRET. This is used to authenticate the webhook event from Supabase.`,
})
.min(1)
.parse(process.env.SUPABASE_DB_WEBHOOK_SECRET);