Skip to content

Commit

Permalink
Improve verification method controller check error.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Aug 25, 2024
1 parent 020f107 commit 4acf6bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixed
- Throw better error if JWT verification method cannot be retrieved
from `kid` URL.
- Improve verification method controller check error.

## 21.0.0 - 2024-08-19

Expand Down
4 changes: 2 additions & 2 deletions lib/vcjwt.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ async function _verifyJwt({jwt, proofPurpose, audience} = {}) {
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 "${controller}" did not authorize ` +
`verification method "${vm.id}" for the purpose ` +
Expand Down

0 comments on commit 4acf6bf

Please sign in to comment.