diff --git a/src/index.d.ts b/src/index.d.ts index 73f794f..1034bd8 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -66,7 +66,7 @@ type VerifierCallback = (e: Error | TokenError | null, payload: any) => void type DecodedJwt = { header: { [key: string]: any }, - payload: string, + payload: any, signature: string } diff --git a/test/types.spec.ts b/test/types.spec.ts index f6c07f3..d0db95a 100644 --- a/test/types.spec.ts +++ b/test/types.spec.ts @@ -63,7 +63,10 @@ createVerifier({ // Dynamic key in async style createVerifier({ clockTimestamp: 10, - async key(_decodedJwt: DecodedJwt) { + async key(decodedJwt: DecodedJwt) { + if (decodedJwt.payload.iss) { + return 'ISS_KEY' + } return 'KEY' } })('456').then(console.log, console.log)