fix: configure admin client with service role options and better error logging

- Add auth options (autoRefreshToken: false, persistSession: false) to
  createAdminClient so service role key works correctly with supabase-js
- Return actual Supabase error message in candidature API for debugging

https://claude.ai/code/session_01H2aRGDaKgarPvhay2HxN6Y
This commit is contained in:
Claude
2026-02-09 18:52:45 +00:00
parent 231667c2c6
commit db51e21075
2 changed files with 9 additions and 3 deletions

View File

@@ -70,6 +70,12 @@ export const createClient = async () => {
export const createAdminClient = () => {
return createSupabaseClient<Database>(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.SUPABASE_SERVICE_ROLE_KEY!
process.env.SUPABASE_SERVICE_ROLE_KEY!,
{
auth: {
autoRefreshToken: false,
persistSession: false,
},
}
);
};