How to grab access token from getClaims call?
Good afternoon,
I was wondering if it's possible to get a users access token from a getClaims call.
I'm working on an API call that sends off a request to Inngest to run some background tasks. In one of the steps I need to create the client with the access token to update data for the user.
Since this is all server side, I don't want to use getSession on the server as it's not recommended. Is there a better way to handle this?
My API that sends the request to Inngest:
6 Replies
The JWT is the access token. So if getClaims works then the access token is valid.
I see thank you. Just to follow up on this with more context, I am trying to send the JWT to the Inngest environment to create the client. Maybe I'm just not understanding which field of the getClaims response is the proper JWT to use here.
GetClaims is provided the JWT. Default it used the JWT from the user session. That is where the claims come from.
So this case sending access_token back to create the client is fine since getClaims was successful prior to that
Probably was fine anyway. If you just use Supabase-js to make calls with it , verification happens when you hit the REST API.
Awesome, thanks for your help Gary!