From 06310d78c9b994ddbdec9f88f404d882b599d820 Mon Sep 17 00:00:00 2001 From: Gregor Martynus <39992+gr2m@users.noreply.github.com> Date: Wed, 28 Aug 2024 20:19:55 -0700 Subject: [PATCH] refactor: avoid unnecessary variable --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 7fac892..9d1c8dc 100644 --- a/index.js +++ b/index.js @@ -12,11 +12,11 @@ export async function verifyRequest(rawBody, signature, key) { assertValidString(signature, "Invalid signature"); assertValidString(key, "Invalid key"); - const verify = createVerify("SHA256").update(rawBody); - // verify signature try { - return verify.verify(key, signature, "base64"); + return createVerify("SHA256") + .update(rawBody) + .verify(key, signature, "base64"); } catch { return false; }