add(feat): verification
This commit is contained in:
@@ -6,6 +6,11 @@ class NotificationController {
|
||||
const payload = req.body;
|
||||
|
||||
try {
|
||||
const callbackToken = req.headers['x-callback-token'];
|
||||
if (callbackToken !== process.env.ROUTER_CALLBACK_TOKEN) {
|
||||
return responseHelper.error(res, "Unauthorized token router gateway", 401);
|
||||
}
|
||||
|
||||
const isValid = notificationService.verifySignature(payload);
|
||||
if (!isValid) {
|
||||
return responseHelper.error(res, "Invalid Signature Key", 403);
|
||||
|
||||
Reference in New Issue
Block a user