From cb7eac90b142ed439630e8fbed35de77202df56f Mon Sep 17 00:00:00 2001
From: Mattsson <111893710+mattssonn@users.noreply.github.com>
Date: Thu, 28 May 2026 16:41:44 +0200
Subject: [PATCH] fix(dashboard): update Recapt integration to load globally
and streamline widget rendering (#592)
---
app/(dashboard)/layout.tsx | 16 +++++-----------
app/layout.tsx | 4 ++++
components/RecaptLoader.tsx | 28 ++++++++++------------------
3 files changed, 19 insertions(+), 29 deletions(-)
diff --git a/app/(dashboard)/layout.tsx b/app/(dashboard)/layout.tsx
index cb12e080..ebbf7a52 100644
--- a/app/(dashboard)/layout.tsx
+++ b/app/(dashboard)/layout.tsx
@@ -5,8 +5,6 @@ import DashboardNav from '@/components/dashboard/DashboardNav'
import { MainContainer } from '@/components/dashboard/MainContainer'
import CompanyTabSync from '@/components/dashboard/CompanyTabSync'
import { RecaptIdentify } from '@/components/RecaptIdentify'
-import { RecaptLoader } from '@/components/RecaptLoader'
-import { RecaptHideWidget } from '@/components/RecaptHideWidget'
import { AgentSheetProvider } from '@/components/agent/AgentSheetProvider'
import AgentTrigger from '@/components/agent/AgentTrigger'
import CommandPalette from '@/components/common/CommandPalette'
@@ -282,15 +280,11 @@ export default async function DashboardLayout({
{!isSandbox && (
- <>
-
-
-
- >
+
)}
diff --git a/app/layout.tsx b/app/layout.tsx
index 159e8a52..203301b9 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -6,6 +6,8 @@ import { NextIntlClientProvider } from "next-intl";
import { getLocale, getMessages } from "next-intl/server";
import { Toaster } from "@/components/ui/toaster";
import { ThemeProvider } from "@/components/theme-provider";
+import { RecaptLoader } from "@/components/RecaptLoader";
+import { RecaptHideWidget } from "@/components/RecaptHideWidget";
import { ensureInitialized } from "@/lib/init";
import { getBranding } from "@/lib/branding/service";
import "./globals.css";
@@ -70,6 +72,7 @@ export default async function RootLayout({
+
{children}
+
diff --git a/components/RecaptLoader.tsx b/components/RecaptLoader.tsx
index 5c56e962..0c029ac2 100644
--- a/components/RecaptLoader.tsx
+++ b/components/RecaptLoader.tsx
@@ -1,31 +1,23 @@
-'use client'
-
-import Script from 'next/script'
-
/**
- * Loads the Recapt SDK for authenticated dashboard users only.
+ * Loads the Recapt SDK globally.
*
- * Privacy guard rails:
- * - Mounted inside the dashboard layout, so the script never loads on
- * public pages (login, register, privacy policy, marketing). This
- * prevents pre-consent IP/fingerprint collection on those routes.
- * - The public key is sourced from NEXT_PUBLIC_RECAPT_PUBLIC_KEY so
- * hosted and self-hosted deployments can each supply their own key
- * (or disable Recapt entirely by leaving it unset).
- * - data-persist / data-enable-user-comments are intentionally omitted
- * from the default tag. Persistent cross-session tracking and
- * unstructured free-text capture are opt-in product decisions, not
- * defaults (GDPR Art. 25 — privacy by default).
+ * Renders a plain