Hi there,
I am trying to figure out how to protect my api and make requests from react native using a nextjs application as server.
So what I tested so far:
→ Auth0 with nextjs using cookies: All good.
→ Auth0 withApiAuth to protect routes: All good.
→ Auth0 withSsr: all good.
So since nextjs and auth0 make use of cookies I created my own validation (protectedRoute()) that I first check if the request is coming from mobile, if so I wanna verify the access_token from the authorization bearer token and I am struggling to figure this part out. So…
- So far I have the access_token issued from react native and I need it in my nextjs api route to verify the access_token get the user details and continue. How can I do that?
If I could resolve this issue, then my custom function would work with both jwt and cookies depending on the origin of the request.