is the authed user being populated in edge function?

I mean, the one who sends the request, i want to get the user's information who sends the request to the edge function.

i am able to do it by the following code:

const session = await supabaseClient.auth.api.getUser(getTokenFromReq(req));

works great!

just wonder if it is the correct way, since i assume consider the user is authenticated, should not the info being fetched as well, so i do not need to waste another call?

but if my assumption is wrong, then my current way should be totally fine.

just need a confirmation, thanks 🙂
Was this page helpful?