Groups can now be ordered (via drag and drop)
This commit is contained in:
parent
16c484c2d1
commit
975d1ceee2
14 changed files with 461 additions and 54 deletions
|
|
@ -410,6 +410,28 @@ WHERE [email] = $1
|
|||
Ok(GetTokenResetPasswordResult::Ok(token))
|
||||
}
|
||||
|
||||
pub async fn is_reset_password_token_valid(
|
||||
&self,
|
||||
token: &str,
|
||||
validation_time: Duration,
|
||||
) -> Result<bool> {
|
||||
if let Some(Some(db_datetime)) = sqlx::query_scalar::<_, Option<DateTime<Utc>>>(
|
||||
r#"
|
||||
SELECT [password_reset_datetime]
|
||||
FROM [User]
|
||||
WHERE [password_reset_token] = $1
|
||||
"#,
|
||||
)
|
||||
.bind(token)
|
||||
.fetch_optional(&self.pool)
|
||||
.await?
|
||||
{
|
||||
Ok(Utc::now() - db_datetime <= validation_time)
|
||||
} else {
|
||||
Ok(false)
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn reset_password(
|
||||
&self,
|
||||
new_password: &str,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue