@konplit-services/common 1.0.132 → 1.0.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.monoVerifyWebhook = void 0;
|
|
4
|
+
const app_configs_1 = require("../app.configs");
|
|
5
|
+
const helper_1 = require("../helper");
|
|
6
|
+
const errors_1 = require("../errors");
|
|
7
|
+
const monoVerifyWebhook = (req, res, next) => {
|
|
8
|
+
const { webhook_secret } = app_configs_1.appConfigs.getMonoDetails();
|
|
9
|
+
if (req.headers["mono-webhook-secret"] !== webhook_secret) {
|
|
10
|
+
throw new errors_1.NotAuthorizedError("You do not have permission to access this endpoint", helper_1.error_codes.INVALID_FORBIDDEN);
|
|
11
|
+
}
|
|
12
|
+
next();
|
|
13
|
+
};
|
|
14
|
+
exports.monoVerifyWebhook = monoVerifyWebhook;
|