SupabaseS
Supabase12mo ago
Sam

Edge Function getUser user is always null

I have the following code, but User in my response is always null. I've taken the code from the docs, and I'm not entirely sure what I'm doing wrong?

Deno.serve(async (req) => {
  const authHeader = req.headers.get("Authorization")!;
  const token = authHeader.replace("Bearer ", "");
  const { data } = await supabase.auth.getUser(token);
  console.log(data);
});


[Info] data { user: null }


https://supabase.com/docs/guides/functions/auth
Supabase Edge Functions and Auth.
Was this page helpful?