Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Add user token initialization in auth.mdx (#32997)

Filippo Brigati83947491f38d
diff --git a/apps/docs/content/guides/functions/auth.mdx b/apps/docs/content/guides/functions/auth.mdx
index 7b97b497278..17ef8d77112 100644
--- a/apps/docs/content/guides/functions/auth.mdx
+++ b/apps/docs/content/guides/functions/auth.mdx
@@ -19,6 +19,11 @@ 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') },
+ },
+ }
);
// Get the session or user object
@@ -43,6 +48,11 @@ 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') },
+ },
+ }
)
// Get the session or user object
@@ -71,6 +81,11 @@ 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') },
+ },
+ }
);
// Get the session or user object