Browse Source

replace stray use of TimeDelta

pull/4637/head
0x0fbc 11 months ago
parent
commit
90b73c6dbe
  1. 6
      src/api/core/two_factor/duo_oidc.rs

6
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<String, Error> {
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,

Loading…
Cancel
Save