Skip to content

Commit

Permalink
make hcaptcha token optional when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
polymath-eric committed Jun 11, 2024
1 parent 94b6e06 commit af9cce3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libs/cdd-types/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ export const addressZ = extendApi(
}
);

export const hCaptcha = z.string().nonempty("hCaptcha validation token is required");
export const hCaptcha =
process.env['HCAPTCHA_IS_ENABLED'] === 'true'
? z.string().nonempty('hCaptcha validation token is required')
: z.optional(z.string());

0 comments on commit af9cce3

Please sign in to comment.