fix: forward invite error status and add listUsers pagination
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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' },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user