Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cottinisimone committed Mar 7, 2024
1 parent 0af2561 commit 55829cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/auth0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use std::sync::{Arc, RwLock, RwLockReadGuard, RwLockWriteGuard};
use std::time::Duration;

use jwks_client_rs::JwksClient;
use jwks_client_rs::source::WebSource;
use jwks_client_rs::JwksClient;
use reqwest::Client;
use tokio::task::JoinHandle;
use tokio::time::Interval;
Expand Down Expand Up @@ -54,7 +54,7 @@ impl Auth0 {
cache.clone(),
config,
)
.await;
.await;

Ok(Self { token_lock })
}
Expand Down Expand Up @@ -91,7 +91,10 @@ async fn start(

match Token::fetch(&client, &config).await {
Ok(token) => {
let is_signed: bool = jwks_client.decode::<Claims>(token.as_str(), &[config.audience()]).await.is_ok();
let is_signed: bool = jwks_client
.decode::<Claims>(token.as_str(), &[config.audience()])
.await
.is_ok();
tracing::info!("is signed: {}", is_signed);

let _ = cache.put_token(&token).await.log_err("Error caching JWT");
Expand Down
2 changes: 1 addition & 1 deletion src/auth0/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ impl From<&Config> for FetchTokenRequest {
pub struct Claims {
#[serde(default)]
pub permissions: Vec<String>,
}
}

0 comments on commit 55829cd

Please sign in to comment.