Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-16 04:12:53 +01:00
replace stray use of TimeDelta
Dieser Commit ist enthalten in:
Ursprung
542a5d3cb1
Commit
dd4e5d6c16
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
|
@ -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,
|
||||
|
|
Laden …
In neuem Issue referenzieren