Replies: 1 comment 4 replies
-
| You can easily do that in your own code following the token's general verification. You can even have it throw the same type of error. import { jwtVerify } from 'jose'
import { JWTClaimValidationFailed } from 'jose/errors'
let token!: string
let key!: CryptoKey
const verified = await jwtVerify(token, key, { issuer: 'foo', requiredClaims: ['myCustomClaim'] });
if (verified.payload.myCustomClaim !== 'bar') {
  throw new JWTClaimValidationFailed(
	'myCustomClaim validation failed',
	verified.payload, 
	'myCustomClaim', 
	'invalid',
  )
} | 
Beta Was this translation helpful? Give feedback.
                  
                    4 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Would it be possible to extend
jwtVerifyto accept more claims other than those provided inJWTVerifyOptions? For example:Beta Was this translation helpful? Give feedback.
All reactions