From c785b2379c73e3727a80dc03a6eeeda583e6f22e Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 14 Oct 2025 08:02:32 +0000 Subject: [PATCH] Serialize listUsers errors in check-verification endpoint cgen-9eb61c7392a1442db969fb84fa614b44 --- server/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/index.ts b/server/index.ts index ce97c6b9..f07756f3 100644 --- a/server/index.ts +++ b/server/index.ts @@ -121,7 +121,8 @@ export function createServer() { const { data, error } = await adminSupabase.auth.admin.listUsers({ email }); if (error) { console.error("[API] listUsers error:", error); - return res.status(error.status ?? 500).json({ error: error.message || String(error) }); + 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;