fix: forward invite error status and add listUsers pagination

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-10 13:05:26 +03:00
parent 9ab728d721
commit b154996500
2 changed files with 2 additions and 2 deletions
@@ -47,7 +47,7 @@ Deno.serve(async (req) => {
const { data, error } = await supabaseAdmin.auth.admin.inviteUserByEmail(email);
if (error) {
return new Response(JSON.stringify({ error: error.message }), {
status: 500,
status: error.status ?? 500,
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
});
}
+1 -1
View File
@@ -37,7 +37,7 @@ Deno.serve(async (req) => {
Deno.env.get('SUPABASE_URL')!,
Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!,
);
const { data: { users }, error } = await supabaseAdmin.auth.admin.listUsers();
const { data: { users }, error } = await supabaseAdmin.auth.admin.listUsers({ page: 1, perPage: 1000 });
if (error) {
return new Response(JSON.stringify({ error: error.message }), {
status: 500,