18 lines
397 B
JavaScript
18 lines
397 B
JavaScript
/**
|
|
* VSSTA Integration Middleware
|
|
* @param req
|
|
* @param res
|
|
* @param next
|
|
* @returns {*}
|
|
*/
|
|
const vsstaIntegrationMiddleware = (req, res, next) => {
|
|
if (req.headers["vssta-integration-secret"] !== process.env.VSSTA_INTEGRATION_SECRET) {
|
|
return res.status(401).send("Unauthorized");
|
|
}
|
|
|
|
req.isIntegrationAuthorized = true;
|
|
next();
|
|
};
|
|
|
|
module.exports = vsstaIntegrationMiddleware;
|