File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ export interface VerifierOptions {
140
140
clockTolerance ?: number
141
141
requiredClaims ?: Array < string >
142
142
checkTyp ?: string
143
+ cacheKeyBuilder ?: ( token : string ) => string
143
144
}
144
145
145
146
export interface PrivateKey {
Original file line number Diff line number Diff line change @@ -93,6 +93,15 @@ createVerifier<Record<string, number>>({
93
93
checkTyp : 'JWT'
94
94
} ) ( { key : 1 } ) . then ( console . log , console . log )
95
95
96
+ // Verifier with cacheKeyBuilder
97
+ createVerifier < Record < string , number > > ( {
98
+ key : 'KEY' ,
99
+ algorithms : [ 'RS256' ] ,
100
+ requiredClaims : [ 'aud' ] ,
101
+ checkTyp : 'JWT' ,
102
+ cacheKeyBuilder : ( token : string ) => token
103
+ } ) ( { key : 1 } ) . then ( console . log , console . log )
104
+
96
105
// Errors
97
106
const wrapped = TokenError . wrap ( new Error ( 'ORIGINAL' ) , 'FAST_JWT_INVALID_TYPE' , 'MESSAGE' )
98
107
wrapped . code === 'FAST_JWT_INVALID_TYPE'
You can’t perform that action at this time.
0 commit comments