Skip to content

Error Messages are misleading #235

Description

@ubamrein

let jwt = try JWT<ClaimType>(jwtString: jwtString, verifier: jwtVerifier)

According to the JWT documentation, if the constructor fails, it could also be that the signature was wrong.

Decode a JWT from a JWT string
A JWT struct can be initialized from a JWT string. If a JWTVerifier is provided it will be used to verify the signature before initialization

Whereas the validateClaims function only validates the claims on the JWT (e.g. nbf or exp) and does nothing regarding the signature:

guard validationResult == .success else {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions