diff --git a/meilisearch-http/src/extractors/authentication/mod.rs b/meilisearch-http/src/extractors/authentication/mod.rs index ebd5abf01..43949144b 100644 --- a/meilisearch-http/src/extractors/authentication/mod.rs +++ b/meilisearch-http/src/extractors/authentication/mod.rs @@ -144,6 +144,7 @@ pub mod policies { pub static TENANT_TOKEN_VALIDATION: Lazy = Lazy::new(|| { let mut validation = Validation::default(); validation.validate_exp = false; + validation.required_spec_claims.remove("exp"); validation.algorithms = vec![Algorithm::HS256, Algorithm::HS384, Algorithm::HS512]; validation }); @@ -205,9 +206,7 @@ pub mod policies { return None; } - let mut validation = Validation::default(); - validation.validate_exp = false; - validation.validate_nbf = false; + let mut validation = TENANT_TOKEN_VALIDATION.clone(); validation.insecure_disable_signature_validation(); let dummy_key = DecodingKey::from_secret(b"secret"); let token_data = decode::(token, &dummy_key, &validation).ok()?;