mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2026-01-07 03:31:31 +01:00
deps: update chrono to 0.4
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
This commit is contained in:
@@ -7,7 +7,7 @@ use hyper::header::ContentType;
|
||||
use url::form_urlencoded;
|
||||
use itertools::Itertools;
|
||||
use serde_json as json;
|
||||
use chrono::{self, UTC};
|
||||
use chrono::{self, Utc};
|
||||
use std::borrow::BorrowMut;
|
||||
use std::io::Read;
|
||||
use std::i64;
|
||||
@@ -133,7 +133,7 @@ impl<C> DeviceFlow<C>
|
||||
let pi = PollInformation {
|
||||
user_code: decoded.user_code,
|
||||
verification_url: decoded.verification_url,
|
||||
expires_at: UTC::now() + chrono::Duration::seconds(decoded.expires_in),
|
||||
expires_at: Utc::now() + chrono::Duration::seconds(decoded.expires_in),
|
||||
interval: Duration::from_secs(i64::abs(decoded.interval) as u64),
|
||||
};
|
||||
self.state = Some(DeviceFlowState::Pending(pi.clone()));
|
||||
@@ -175,7 +175,7 @@ impl<C> DeviceFlow<C>
|
||||
_ => panic!("You have to call request_code() beforehand"),
|
||||
};
|
||||
|
||||
if pi.expires_at <= UTC::now() {
|
||||
if pi.expires_at <= Utc::now() {
|
||||
self.error = Some(PollError::Expired(pi.expires_at));
|
||||
self.state = Some(DeviceFlowState::Error);
|
||||
return Err(&self.error.as_ref().unwrap());
|
||||
|
||||
Reference in New Issue
Block a user