Next.js Discord

Discord Forum

Proxy all api routes

Unanswered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
There is an existing backend that authenticates users based on the authorization bearer header, i'd like to put that bearer token inside of a cookie so nextjs can render user pages for the user (without page flashes). Is there a way to proxy all requests of /api? Or is this not recommended?

2 Replies

I think this is exactly what you're looking for!