From 303f8091ea3d402fc3c80990a4cd55510df05672 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 14 Oct 2025 07:15:58 +0000 Subject: [PATCH] Guard clipboard usage cgen-e718117cd4404689a6e055734d1fc3b6 --- client/pages/Login.tsx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/client/pages/Login.tsx b/client/pages/Login.tsx index eb517bbc..3a5bd4b0 100644 --- a/client/pages/Login.tsx +++ b/client/pages/Login.tsx @@ -68,12 +68,19 @@ export default function Login() { } else if (result?.verificationUrl) { setManualVerificationLink(result.verificationUrl); try { - await navigator.clipboard?.writeText(result.verificationUrl); - toastInfo({ - title: "Verification link copied", - description: - "We copied the manual verification link to your clipboard. Paste it into your browser to finish signup.", - }); + if ( + typeof navigator !== "undefined" && + navigator.clipboard?.writeText + ) { + await navigator.clipboard.writeText(result.verificationUrl); + toastInfo({ + title: "Verification link copied", + description: + "We copied the manual verification link to your clipboard. Paste it into your browser to finish signup.", + }); + } else { + throw new Error("clipboard unsupported"); + } } catch { toastInfo({ title: "Manual verification required",