mirror of
https://github.com/danbulant/jose
synced 2026-05-24 20:41:46 +00:00
refactor: form flattened jws explicitly in general verify
This commit is contained in:
parent
47d7001c02
commit
f511889936
1 changed files with 10 additions and 2 deletions
|
|
@ -81,10 +81,18 @@ export default async function generalVerify(
|
|||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const signature of jws.signatures) {
|
||||
const flattened = { payload: jws.payload, ...signature }
|
||||
try {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
return await verify(flattened, <Parameters<typeof verify>[1]>key, options)
|
||||
return await verify(
|
||||
{
|
||||
header: signature.header,
|
||||
payload: jws.payload,
|
||||
protected: signature.protected,
|
||||
signature: signature.signature,
|
||||
},
|
||||
<Parameters<typeof verify>[1]>key,
|
||||
options,
|
||||
)
|
||||
} catch {
|
||||
//
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue