From f4187b44469192edbe30b3c392f9e9ec36bdd97c Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Sat, 24 Aug 2024 23:46:44 -0400 Subject: [PATCH] Improve verification method controller check error. --- CHANGELOG.md | 5 +++++ lib/verify.js | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e4cbde..d30ea32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # bedrock-vc-delivery ChangeLog +## 5.3.3 - 2024-08-dd + +### Fixed +- Improve verification method controller check error. + ## 5.3.2 - 2024-08-24 ### Fixed diff --git a/lib/verify.js b/lib/verify.js index cfbc246..afcfa9e 100644 --- a/lib/verify.js +++ b/lib/verify.js @@ -181,9 +181,9 @@ export async function verifyDidProofJwt({workflow, exchange, jwt} = {}) { if(typeof match === 'string') { match = didDoc?.verificationMethod?.find?.(e => e.id === vm.id); } - if(!(match && Array.isArray(match.controller) ? + if(!(match && (Array.isArray(match.controller) ? match.controller.includes(vm.controller) : - match.controller === vm.controller)) { + match.controller === vm.controller))) { throw new BedrockError( `Verification method controller "${issuer}" did not authorize ` + `verification method "${vm.id}" for the purpose of "authentication".`, {