mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Chore: update also last example on the page (#32809)
This commit is contained in:
1 parent
3e94bc483c
commit
f233c78794
1 file changed
+6
-4
@@ -71,11 +71,13 @@ Deno.serve(async (req: Request) => {
|
||||
const supabaseClient = createClient(
|
||||
Deno.env.get('SUPABASE_URL') ?? '',
|
||||
Deno.env.get('SUPABASE_ANON_KEY') ?? '',
|
||||
{ global: { headers: { Authorization: req.headers.get('Authorization')! } } }
|
||||
)
|
||||
);
|
||||
|
||||
// Database queries will have RLS policies enforced
|
||||
const { data, error } = await supabaseClient.from('profiles').select('*')
|
||||
// Get the session or user object
|
||||
const authHeader = req.headers.get('Authorization')!;
|
||||
const token = authHeader.replace('Bearer ', '');
|
||||
const { data: userData } = await supabaseClient.auth.getUser(token);
|
||||
const { data, error } = await supabaseClient.from('profiles').select('*');
|
||||
|
||||
return new Response(JSON.stringify({ data }), {
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
|
||||
Reference in new issue
Block a user