diff options
Diffstat (limited to 'src/api/auth/account.rs')
-rw-r--r-- | src/api/auth/account.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/api/auth/account.rs b/src/api/auth/account.rs index 8f3ac55..d96229d 100644 --- a/src/api/auth/account.rs +++ b/src/api/auth/account.rs @@ -1,13 +1,13 @@ use std::sync::Arc; use anyhow::Result; -use chrono::{DateTime, Utc}; use password_hash::SaltString; use rand::{thread_rng, Rng}; use rocket::request::FromRequest; use rocket::State; use rocket::{serde::json::Json, Request}; use serde::{Deserialize, Serialize}; +use time::OffsetDateTime; use validator::Validate; use crate::api::{Empty, EMPTY}; @@ -19,7 +19,7 @@ use crate::types::{AccountResetID, HawkKey}; use crate::utils::DeferAction; use crate::Config; use crate::{ - api::{auth, serialize_dt}, + api::auth, auth::{AuthSource, Authenticated}, crypto::{AuthPW, KeyBundle, KeyFetchReq, SessionCredentials}, types::{KeyFetchID, OauthToken, SecretKey, User, UserID, VerifyHash}, @@ -56,8 +56,8 @@ pub(crate) struct CreateResp { sessionToken: SessionToken, #[serde(skip_serializing_if = "Option::is_none")] keyFetchToken: Option<KeyFetchToken>, - #[serde(serialize_with = "serialize_dt")] - authAt: DateTime<Utc>, + #[serde(with = "time::serde::timestamp")] + authAt: OffsetDateTime, // MISSING verificationMethod } @@ -165,8 +165,8 @@ pub(crate) struct LoginResp { // NOTE this is the *account* verified status, not the session status. // the spec doesn't say. verified: bool, - #[serde(serialize_with = "serialize_dt")] - authAt: DateTime<Utc>, + #[serde(with = "time::serde::timestamp")] + authAt: OffsetDateTime, // MISSING metricsEnabled } |