© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
7 replies
sudoramen

Fetching user by jwt as admin.

In the docs, an example for Fetch the user object using the access_token jwt. is the same as the code example for Get user by id..
const { data, error } = await supabase.auth.admin.getUserById(1)
const { data, error } = await supabase.auth.admin.getUserById(1)

I tried this with a valid token but get an error
"user_id must be an UUID"
"user_id must be an UUID"
. I'm assuming this line of code got copied over without being fixed, how can I get the user calling the edge function? (context: this is being used in an edge function)

I also tried
const { data: { user } } = await supabase.auth.getUser(jwt)
const { data: { user } } = await supabase.auth.getUser(jwt)

but get
{ data: { user: null }, error: AuthApiError { name: "AuthApiError", message: "Internal server error", status: 500 } }
{ data: { user: null }, error: AuthApiError { name: "AuthApiError", message: "Internal server error", status: 500 } }
back.
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

Auth Admin "Get User by Email"?
SupabaseSSupabase / help-and-questions
3y ago
Fetching countries grouped by continents
SupabaseSSupabase / help-and-questions
4y ago
User ID in Jwt Payload
SupabaseSSupabase / help-and-questions
7mo ago
Get JWT from another user
SupabaseSSupabase / help-and-questions
8mo ago