mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-06-02 05:50:20 +00:00
Fixing validation (#2179)
This commit is contained in:
parent
e861ebcda0
commit
563e3d3109
|
@ -18,6 +18,7 @@ impl Claims {
|
|||
pub fn decode(jwt: &str, jwt_secret: &str) -> Result<TokenData<Claims>, LemmyError> {
|
||||
let mut validation = Validation::default();
|
||||
validation.validate_exp = false;
|
||||
validation.required_spec_claims.remove("exp");
|
||||
let key = DecodingKey::from_secret(jwt_secret.as_ref());
|
||||
Ok(decode::<Claims>(jwt, &key, &validation)?)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue