© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•14mo ago•
1 reply
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);
});
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 }
[Info] data { user: null }


https://supabase.com/docs/guides/functions/auth
Integrating With Supabase Auth | Supabase Docs
Supabase Edge Functions and Auth.
Integrating With Supabase Auth | Supabase Docs
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

supabase auth.getUser always returns null
SupabaseSSupabase / help-and-questions
4y ago
Auth.getUser() can not find user in edge function
SupabaseSSupabase / help-and-questions
13mo ago
Edge Function Delete User
SupabaseSSupabase / help-and-questions
4y ago
Cant get user from getUser() through async function
SupabaseSSupabase / help-and-questions
4y ago