From 8ec81b3a48a53b26797f60d4cbec5744b94f0732 Mon Sep 17 00:00:00 2001 From: nikhil kumar Date: Thu, 10 Oct 2024 11:38:21 +0530 Subject: [PATCH] fix: minor change for hmac sig validation --- backend/src/utils/crypto.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/utils/crypto.ts b/backend/src/utils/crypto.ts index 7194481..302527f 100644 --- a/backend/src/utils/crypto.ts +++ b/backend/src/utils/crypto.ts @@ -66,7 +66,7 @@ export function verifySignature(signature: string, data: string, timestamp: stri // unauthorize signature if signed before 10s or signed in future. const now = Date.now(); if( - now > parseInt(timestamp) || + now < parseInt(timestamp) || now - parseInt(timestamp) > 10000 ) { return false;