Relative Content

Tag Archive for next.jscookiesfirebase-authentication

Nextjs Middleware authorization: Cannot append headers after they are sent to the client

I have a middleware that makes a request to a route handler endpoint to check if the user is authorized to view a certain page, however I’m getting this error Cannot append headers after they are sent to the client. I understand what it’s telling me but I’m not sure why it is happening. I’m following this post on how to implement this. The only difference between the post’s implementation and mine is that the post use Google Sign In and I’m using email/password, but I wouldn’t think that should matter.