feature/IO-2282-VSSTA-Integration: - checkpoint
This commit is contained in:
17
server/middleware/vsstaIntegrationMiddleware.js
Normal file
17
server/middleware/vsstaIntegrationMiddleware.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* 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;
|
||||
Reference in New Issue
Block a user