Inconsistency in the docs regarding validation
Hello!
According to the docs, if we want to extend the Validation rules we can do it like the example provided in the docs:
// Changing one parameter
let mut validation = Validation {leeway: 60, ..Default::default()};
However if we use this code, we get the following error:
58 | let mut validation = Validation {leeway: 1000 * 60, ..Default::default()};
| ^^^^^^^^^^^^^^^^^^ field `validate_signature` is private
This issue is addressed already before but it was weirdly closed without either fixing it or providing an alternative way to bypass the error and update the docs for it.
https://github.com/Keats/jsonwebtoken/issues/255
Ah the docs should be updated.
Yea that would be nice. In the meantime, would you say that my workaround is the recommended way now?
let mut validation = Validation::default();
validation.leeway = 60;
That or Validation::new(Algorithm::..) with the alg you are using