[ERR_HTTP_HEADERS_SENT]: Cannot append headers after they are sent to the client on middleware.js during authentication
I have a project where I do authentication checking on middleware.js
file. It was doing fine locally and on development server, but when we deploy it to production it got: