NextJS, How inject Authorization header before next.config rewrites happens?
Asked Answered
N

0

6

I'm using NextJS to build our Frontend. The NextJS API just provides basic checks and then redirects to proper micro-services. But I'm struggling to find the proper approach.

Since we are using Next 12 I think next.config rewrites is a nice fit, but I need to augment the req with an Authorization header before the rewrites.

Is that even possible? Or perhaps there's a better solution for this case that I think is a fairly common scenario having a middle-end redirect to proper API.

Nabalas answered 18/2, 2022 at 12:59 Comment(1)
Did you find an elegant solution to this? If so would you mind sharing as I'm in a similar situation.Sunshine

© 2022 - 2024 — McMap. All rights reserved.