In nodejs created a gateway that proxies the apis based on some conditions. The gateway also checks the headers in token and if validated then set the req.user
Here is the proxy code
proxy(host) {
// call proxy middleware with request option
return (req, res, next) => {
let reqBodyEncoding;
let reqAsBuffer = false;
let parseReqBody = true;
return default_proxy(host, {
reqAsBuffer,
reqBodyEncoding,
parseReqBody,
})(req, res, next);
}
}
now on my proxied service I am not getting req.user
. What is the solution for this?