This commit is contained in:
2026-06-28 18:12:00 +02:00
parent 5152ec0f7e
commit 7a593fc204
27 changed files with 413 additions and 100 deletions
-2
View File
@@ -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)
}