Skip to content

Commit

Permalink
fix-auth-date-parse (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
RWDai authored Oct 18, 2023
1 parent e0b0042 commit 4590382
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions support/auth/src/serv/auth_kernel_serv.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

use tardis::chrono::{DateTime, Utc};
use tardis::chrono::{NaiveDateTime, Utc};
use tardis::{
basic::{dto::TardisContext, error::TardisError, result::TardisResult},
cache::cache_client::TardisCacheClient,
Expand Down Expand Up @@ -309,7 +309,7 @@ async fn parsing_base_ak(ak_authorization: &str, req: &AuthReq, config: &AuthCon
"401-auth-req-ak-not-exist",
));
}
let req_head_time = if let Ok(date_time) = DateTime::parse_from_str(req_date, &config.head_date_format) {
let req_head_time = if let Ok(date_time) = NaiveDateTime::parse_from_str(req_date, &config.head_date_format) {
date_time.timestamp_millis()
} else {
return Err(TardisError::bad_request("[Auth] bad date format", "401-auth-req-date-incorrect"));
Expand Down

0 comments on commit 4590382

Please sign in to comment.