Skip to content

Commit

Permalink
update auth setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jipperism committed Nov 1, 2023
1 parent 93a13f0 commit 7a6ba9c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/supabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,15 @@ export const supabase = createClient<Database>(
);

export const getSupabaseAuthenticatedClient = (token: string) => {
return createClient<Database>(process.env.NEXT_PUBLIC_SUPABASE_URL!, token);
return createClient<Database>(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
global: {
headers: {
Authorization: `Bearer ${token}`,
},
},
},
);
};

0 comments on commit 7a6ba9c

Please sign in to comment.