From 4656df7fca448364078a6a43097e978c5403fed4 Mon Sep 17 00:00:00 2001 From: Nareshkumar Rao Date: Thu, 3 Apr 2025 13:25:44 +0200 Subject: [PATCH] fix wrong env name --- src/app/contact/action.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/contact/action.ts b/src/app/contact/action.ts index 801800a..23a0c11 100644 --- a/src/app/contact/action.ts +++ b/src/app/contact/action.ts @@ -6,7 +6,7 @@ export async function getReCaptchaSiteKey() { return process.env.RECAPTCHA_SITE_KEY; } -const RECAPTCHA_SECRET_KEY = process.env.RECAPTCHA_SECRET_KEY; +const RECAPTCHA_SERVER_KEY = process.env.RECAPTCHA_SERVER_KEY; export type SubmitContactReturn = { error: string } | { success: true }; @@ -14,9 +14,9 @@ export default async function SubmitContact( prevState: unknown, data: FormData ): Promise { - if (!RECAPTCHA_SECRET_KEY) { + if (!RECAPTCHA_SERVER_KEY) { console.error( - "RECAPTCHA_SECRET_KEY is not set. Please check your environment variables." + "RECAPTCHA_SERVER_KEY is not set. Please check your environment variables." ); throw new Error("Server error: RECAPTCHA not configure correctly."); } @@ -42,7 +42,7 @@ export default async function SubmitContact( headers: { "Content-Type": "application/x-www-form-urlencoded", }, - body: `secret=${RECAPTCHA_SECRET_KEY}&response=${recaptcha}`, + body: `secret=${RECAPTCHA_SERVER_KEY}&response=${recaptcha}`, } ); const recaptchaData = await recaptchaResponse.json();