Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Messages are misleading #235

Open
ubamrein opened this issue Nov 2, 2020 · 0 comments
Open

Error Messages are misleading #235

ubamrein opened this issue Nov 2, 2020 · 0 comments

Comments

@ubamrein
Copy link

ubamrein commented Nov 2, 2020

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 {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant