crate updates

This commit is contained in:
Philippe Loctaux 2023-11-20 23:19:01 +01:00
parent 3aa1e9546d
commit 311fbb2170
4 changed files with 722 additions and 681 deletions

View file

@ -39,9 +39,10 @@ impl PasswordResetToken {
pub fn parse(raw: &str) -> Result<Self, Error> {
let (token, timestamp_str) = raw.split_once('-').ok_or(Error::TokenFormat)?;
let expires_at = Utc
.datetime_from_str(timestamp_str, "%s")
.map_err(|_| Error::TimeFormat)?;
let expires_at = DateTime::parse_from_str(timestamp_str, "%s")
.map_err(|_| Error::TimeFormat)?
.naive_utc()
.and_utc();
Ok(Self {
token: token.to_string(),