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:
@@ -2,8 +2,16 @@ import { z } from 'zod';
|
||||
|
||||
export const StripeServerEnvSchema = z
|
||||
.object({
|
||||
secretKey: z.string().min(1),
|
||||
webhooksSecret: z.string().min(1),
|
||||
secretKey: z
|
||||
.string({
|
||||
required_error: `Please provide the variable STRIPE_SECRET_KEY`,
|
||||
})
|
||||
.min(1),
|
||||
webhooksSecret: z
|
||||
.string({
|
||||
required_error: `Please provide the variable STRIPE_WEBHOOK_SECRET`,
|
||||
})
|
||||
.min(1),
|
||||
})
|
||||
.refine(
|
||||
(schema) => {
|
||||
|
||||
Reference in New Issue
Block a user