Init
This commit is contained in:
@@ -36,13 +36,11 @@ pub fn create_jwt(
|
||||
}
|
||||
|
||||
pub fn verify_jwt(token: &str, secret: &str) -> Result<Claims, jsonwebtoken::errors::Error> {
|
||||
println!("Verifying token: {}", token);
|
||||
let validation = Validation::default();
|
||||
let token_data = decode::<Claims>(
|
||||
token,
|
||||
&DecodingKey::from_secret(secret.as_ref()),
|
||||
&validation,
|
||||
)?;
|
||||
println!("Token data: {:?}", token_data);
|
||||
Ok(token_data.claims)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user