Skip to main content

validate_token

Function validate_token 

Source
pub fn validate_token(
    token: &str,
    config: &JwtConfig,
) -> Result<Claims, AuthError>
Expand description

Validate an HS256 JWT and return its parsed claims.

Returns AuthError::Jwt if the signature is invalid, the token is expired, or the token is otherwise malformed. Leeway is set to zero so expiry is checked exactly.