Server Side Requests from a Mobile App that uses Client side Auth
I am building a mobile app that uses a server to make requests. Currenty, it is all built with Expo including API routes. I authenticate people on the client and then send requests through the server. I am using RLS on my tables. I want to be able to send authenticated requests through my server while using client side authentication.
How I'm thinking about it.
I'm able to get the correct use on the server through this:
For example, using the Vercel AI SDKK and trying to send the reequest like this.
How I'm thinking about it.
- Before I send a request on the client to the server get the access token from the session.
- Include the access token in the headers as authorization
- Send the request
I'm able to get the correct use on the server through this:
For example, using the Vercel AI SDKK and trying to send the reequest like this.