From dd4e5d6c16639dbffed6afe4750a51b1ced7b089 Mon Sep 17 00:00:00 2001 From: 0x0fbc <10455804+0x0fbc@users.noreply.github.com> Date: Fri, 7 Jun 2024 00:20:14 -0400 Subject: [PATCH] replace stray use of TimeDelta --- src/api/core/two_factor/duo_oidc.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/core/two_factor/duo_oidc.rs b/src/api/core/two_factor/duo_oidc.rs index 003f4125..546e2fa8 100644 --- a/src/api/core/two_factor/duo_oidc.rs +++ b/src/api/core/two_factor/duo_oidc.rs @@ -1,4 +1,4 @@ -use chrono::{TimeDelta, Utc}; +use chrono::Utc; use jsonwebtoken::{Algorithm, DecodingKey, EncodingKey, Header, Validation}; use reqwest::{header, StatusCode}; use serde::Serialize; @@ -235,12 +235,12 @@ impl DuoClient { // Clients are sent here to continue authentication. // https://duo.com/docs/oauthapi#authorization-request fn make_authz_req_url(&self, duo_username: &str, state: String, nonce: String) -> Result { - let now = Utc::now(); + let now = Utc::now().timestamp(); let jwt_payload = AuthorizationRequest { response_type: String::from("code"), scope: String::from("openid"), - exp: (now + TimeDelta::try_seconds(self.jwt_exp_seconds).unwrap()).timestamp(), + exp: now, client_id: self.client_id.clone(), redirect_uri: self.redirect_uri.clone(), state,