From 67a1fe0f7f03d1093c2856e10a3c0eca5f99ecca Mon Sep 17 00:00:00 2001 From: Sosokker Date: Sat, 9 Nov 2024 22:25:34 +0700 Subject: [PATCH] fix: use role key instead of anon key --- tests/helpers/deleteUser.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/helpers/deleteUser.ts b/tests/helpers/deleteUser.ts index 77d0b7b..8f877b6 100644 --- a/tests/helpers/deleteUser.ts +++ b/tests/helpers/deleteUser.ts @@ -1,17 +1,17 @@ import { createClient } from "@supabase/supabase-js"; const supabase_url = process.env.NEXT_PUBLIC_SUPABASE_URL; -const supabase_anon_key = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY; +const supabase_role_key = process.env.SUPABASE_SERVICE_ROLE_KEY; if (!supabase_url) { throw "Supabase Url is undefine"; } -if (!supabase_anon_key) { +if (!supabase_role_key) { throw "Supabase Anon Key is undefine"; } -const supabase = createClient(supabase_url, supabase_anon_key); +const supabase = createClient(supabase_url, supabase_role_key); export async function deleteUser(userId: string) { try {