From 97f3e4d054bc65d048a33478fe2473eb62b5f30e Mon Sep 17 00:00:00 2001 From: Sergey Ukustov Date: Fri, 5 Jul 2024 12:12:00 +0300 Subject: [PATCH] Update src/auth/auth.middleware.ts Co-authored-by: Mohsin Zaidi <2236875+smrz2001@users.noreply.github.com> --- src/auth/auth.middleware.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/auth/auth.middleware.ts b/src/auth/auth.middleware.ts index 8f0c48a4..dbee7de9 100644 --- a/src/auth/auth.middleware.ts +++ b/src/auth/auth.middleware.ts @@ -97,8 +97,7 @@ export function auth(opts: AuthOpts): Handler { const body = req.body const contentType = req.header('Content-Type') const digestCalculated = buildBodyDigest(contentType, body) - const isCorrectDigest = digestCalculated == digest - if (!isCorrectDigest) { + if (digestCalculated !== digest) { logger?.verbose(`Disallowed: Incorrect digest for DID ${did}`) return disallow(res, DISALLOW_REASON.DID_ALLOWLIST_INVALID_DIGEST) }