Force disable exp and nbf validation.

Some clients had the wrong time information so it would fail to validate their token when installing. Remove these checks since they'll be checked on the server side anyway
This commit is contained in:
James Rowe 2019-12-02 09:37:53 -07:00
parent 6af46ec703
commit eb556c8cab

View File

@ -138,7 +138,7 @@ pub fn validate_token(
}; };
// Configure validation for audience and issuer if the configuration provides it // Configure validation for audience and issuer if the configuration provides it
let validation = match validation { let mut validation = match validation {
Some(v) => { Some(v) => {
let mut valid = Validation::new(Algorithm::RS256); let mut valid = Validation::new(Algorithm::RS256);
valid.iss = v.iss; valid.iss = v.iss;
@ -149,7 +149,8 @@ pub fn validate_token(
} }
None => Validation::default(), None => Validation::default(),
}; };
validation.validate_exp = false;
validation.validate_nbf = false;
// Verify the JWT token // Verify the JWT token
decode::<JWTClaims>(&body, pub_key.as_slice(), &validation) decode::<JWTClaims>(&body, pub_key.as_slice(), &validation)
.map(|tok| tok.claims) .map(|tok| tok.claims)