From 7e8cd6c39f592665712f9cd1457fd04ed9107e9f Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 14 Oct 2025 08:54:42 +0000 Subject: [PATCH] Prettier format pending files --- client/components/onboarding/Welcome.tsx | 29 +++++++++++++++++++----- server/index.ts | 22 ++++++++++++++---- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/client/components/onboarding/Welcome.tsx b/client/components/onboarding/Welcome.tsx index 950ee167..dcc5bfdd 100644 --- a/client/components/onboarding/Welcome.tsx +++ b/client/components/onboarding/Welcome.tsx @@ -105,7 +105,9 @@ export default function Welcome({ if (!response.ok) { // If server returned a manual verification link despite the error, surface it to the user. const manualLink = - typeof payload?.verificationUrl === "string" ? payload.verificationUrl : null; + typeof payload?.verificationUrl === "string" + ? payload.verificationUrl + : null; if (manualLink) { setFallbackVerificationLink(manualLink); @@ -118,7 +120,10 @@ export default function Welcome({ } else { toastError({ title: "Verification email failed", - description: payload?.error || payload?.message || "Failed to send verification email", + description: + payload?.error || + payload?.message || + "Failed to send verification email", }); } @@ -196,7 +201,10 @@ export default function Welcome({ // If the client has no active session (common in signup flows), fall back // to a server-side check using the admin Supabase client. const isSessionMissing = - (error && ((error.name && error.name.includes("AuthSessionMissing")) || (error.message && error.message.includes("Auth session missing")))) || + (error && + ((error.name && error.name.includes("AuthSessionMissing")) || + (error.message && + error.message.includes("Auth session missing")))) || false; if (isSessionMissing && emailAddress) { @@ -207,10 +215,14 @@ export default function Welcome({ body: JSON.stringify({ email: emailAddress }), }); - const payload = await resp.json().catch(() => ({} as any)); + const payload = await resp.json().catch(() => ({}) as any); if (!resp.ok) { const serverMessage = - payload?.error || payload?.message || (Object.keys(payload || {}).length ? JSON.stringify(payload) : "Server check failed"); + payload?.error || + payload?.message || + (Object.keys(payload || {}).length + ? JSON.stringify(payload) + : "Server check failed"); console.error("Server check-verification failed", payload); toastError({ title: "Unable to verify", @@ -241,7 +253,12 @@ export default function Welcome({ }); // If the server returned a verification link (manual fallback), surface it. - if (payload?.user && payload?.user?.email && payload?.user?.confirmation_sent_at && !payload?.verified) { + if ( + payload?.user && + payload?.user?.email && + payload?.user?.confirmation_sent_at && + !payload?.verified + ) { // nothing specific to do here other than logging console.debug("User found but not verified", payload.user); } diff --git a/server/index.ts b/server/index.ts index f07756f3..5b781cce 100644 --- a/server/index.ts +++ b/server/index.ts @@ -62,8 +62,13 @@ export function createServer() { code: (error as any)?.code || null, details: (error as any)?.details || null, }); - const errMsg = typeof error === "string" ? error : (error?.message || JSON.stringify(error)); - return res.status((error as any)?.status ?? 500).json({ error: errMsg }); + const errMsg = + typeof error === "string" + ? error + : error?.message || JSON.stringify(error); + return res + .status((error as any)?.status ?? 500) + .json({ error: errMsg }); } const actionLink = @@ -118,11 +123,18 @@ export function createServer() { } try { - const { data, error } = await adminSupabase.auth.admin.listUsers({ email }); + const { data, error } = await adminSupabase.auth.admin.listUsers({ + email, + }); if (error) { console.error("[API] listUsers error:", error); - const errMsg = typeof error === "string" ? error : (error?.message || JSON.stringify(error)); - return res.status((error as any)?.status ?? 500).json({ error: errMsg }); + const errMsg = + typeof error === "string" + ? error + : error?.message || JSON.stringify(error); + return res + .status((error as any)?.status ?? 500) + .json({ error: errMsg }); } const user = (data as any)?.users?.[0] ?? null;