Skip to content

Commit

Permalink
chore(term): set log level for the credential restore process to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Mar 18, 2024
1 parent 2d44d0c commit 30dc7a2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/synd_term/src/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Credential {
path: &Path,
jwt_service: &JwtService,
) -> Result<Self, CredentialError> {
tracing::info!(
debug!(
path = path.display().to_string(),
"Restore credential from cache"
);
Expand All @@ -69,12 +69,11 @@ impl Credential {
if !claims.email_verified {
return Err(CredentialError::GoogleJwtEmailNotVerified);
}
tracing::info!("{claims:?}");
if !claims.is_expired(Utc::now()) {
return Ok(credential);
}

tracing::info!("Google jwt expired, trying to refresh");
debug!("Google jwt expired, trying to refresh");

let id_token = jwt_service
.google
Expand All @@ -89,7 +88,7 @@ impl Credential {

persist_credential(&credential).map_err(CredentialError::PersistCredential)?;

tracing::info!("Persist refreshed credential");
debug!("Persist refreshed credential");

Ok(credential)
}
Expand Down

0 comments on commit 30dc7a2

Please sign in to comment.