I am unsure about how to make API calls from Nextjs 13 to my separate Python backend.
I have two scenarios:
- API call comes from client side component
- API call comes from server side component
The client side component has the correct session cookie from my auth provider (Clerk). So that case is pretty straight forward and I can authenticate the call in the Python backend.
However, when the call comes from the server side session cookies are not included. I could send a JWT token along. But that would add quite a bit of complexity.
What approach would you recommend in that scenario?