try {
const decodedAndVerifiedVincentJWT = verify(jwt, 'https://myapp.com');
} catch(e) {
// Handle invalid/expired JWT casew
}
  • Decodes and verifies an VincentJWT token in string form

    This function returns the decoded VincentJWT object only if:

    1. The JWT signature is valid
    2. The JWT is not expired
    3. All time claims (nbf, iat) are valid
    4. The JWT has an audience claim that includes the expected audience

    Parameters

    • jwt: string

      The JWT string to verify

    • expectedAudience: string

      String that should be in the audience claim(s)

    Returns VincentJWT

    The decoded VincentJWT object if it was verified successfully