From 1efceb86fcac2dff16a1f4a7073337a4137a69e0 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Tue, 29 Mar 2022 10:01:02 -0700 Subject: [PATCH] get exp time out of correct token --- zeroidc/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zeroidc/src/lib.rs b/zeroidc/src/lib.rs index 0f05b86ca..2efaef7fc 100644 --- a/zeroidc/src/lib.rs +++ b/zeroidc/src/lib.rs @@ -203,6 +203,7 @@ impl ZeroIDC { } #[cfg(debug_assertions)] { + println!("now: {:?}\nexp: {:?}", now, exp); println!("Refresh Token: {}", refresh_token.secret()); } @@ -519,15 +520,17 @@ impl ZeroIDC { println!("Status: {}", res.status()); } - let at = tok.access_token().secret(); + let idt = &id_token.to_string(); - let t: Result>, jwt::Error>= Token::parse_unverified(at); + let t: Result>, jwt::Error>= + Token::parse_unverified(idt); if let Ok(t) = t { let claims = t.claims().registered.clone(); match claims.expiration { Some(exp) => { i.exp_time = exp; + println!("Set exp time to: {:?}", i.exp_time); }, None => { panic!("expiration is None. This shouldn't happen")