fn decode_token(token: &str, secret: &[u8]) -> Option<Auth> {
    jwt::decode(
        token,
        &jwt::DecodingKey::from_secret(secret),
        &jwt::Validation::new(jwt::Algorithm::HS256),
    )
    .map_err(|err| {
        eprintln!("Auth decode error: {:?}", err);
    })
    .ok()
    .map(|token_data| token_data.claims)
}
/// Decode token into `Auth` struct. If any error is encountered, log it
/// and return None.
Decode token into `Auth` struct. If any error is encountered, log it
and return None.
Decode token into ` Auth ` struct . If any error is encountered log it and return None .
fn decode_token(token: &str, secret: &[u8]) -> Option<Auth> {
    jwt::decode(
        token,
        &jwt::DecodingKey::from_secret(secret),
        &jwt::Validation::new(jwt::Algorithm::HS256),
    )
    .map_err(|err| {
        eprintln!("Auth decode error: {:?}", err);
    })
    .ok()
    .map(|token_data| token_data.claims)
}
fn decode_token ( token : & str , secret : & [ u8 ] ) -> Option < Auth > { jwt :: decode ( token , & jwt :: DecodingKey :: from_secret ( secret ) , & jwt :: Validation :: new ( jwt :: Algorithm :: HS256 ) , ) . map_err ( | err | { eprintln ! ( " " err ) ; } ) . ok ( ) . map ( | token_data | token_data . claims ) }
Decode token into `Auth` struct.
Decode token into ` Auth ` struct .
token
&str
secret
&[u8]
token
&str
secret
&[u8]