Serialize listUsers errors in check-verification endpoint
cgen-9eb61c7392a1442db969fb84fa614b44
This commit is contained in:
parent
cf13c97239
commit
c785b2379c
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue