Skip to content

Commit 2c85fbc

Browse files
committed
fix: fix jwt renewal time check
1 parent ee21928 commit 2c85fbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/clients/blobscan/jwt_manager.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ impl JWTManager {
4747

4848
match *token_guard {
4949
Some(ref token) => {
50-
let now = Utc::now() - self.safety_margin;
50+
let now = Utc::now() + self.safety_margin;
5151
let expiration_date = expr_guard.ok_or(anyhow::anyhow!(
5252
"JWT expiration date not set. This should not happen"
5353
))?;
5454

55-
if now > expiration_date {
55+
if now >= expiration_date {
5656
debug!(
5757
expiration_date = expiration_date.to_string(),
5858
"JWT expired. Refreshing token"

0 commit comments

Comments
 (0)