Skip to content

Commit

Permalink
refactor: avoid unnecessary variable
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Aug 29, 2024
1 parent d0e33f8 commit 06310d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 06310d7

Please sign in to comment.