1 Commits

Author SHA1 Message Date
8dd455473b Update dependency typescript-eslint to ^8.33.1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-06-03 00:20:21 +00:00

View File

@ -10,6 +10,7 @@ use crate::utils::string_utils::rand_str;
use crate::utils::time_utils::time; use crate::utils::time_utils::time;
use bcrypt::DEFAULT_COST; use bcrypt::DEFAULT_COST;
use diesel::prelude::*; use diesel::prelude::*;
use std::io::ErrorKind;
/// Get the information of a user, by its id /// Get the information of a user, by its id
pub async fn get_by_id(id: UserID) -> anyhow::Result<User> { pub async fn get_by_id(id: UserID) -> anyhow::Result<User> {
@ -24,7 +25,8 @@ pub async fn get_by_mail(mail: &str) -> anyhow::Result<User> {
/// Get the information of a user, by its password reset token /// Get the information of a user, by its password reset token
pub async fn get_by_pwd_reset_token(token: &str) -> anyhow::Result<User> { pub async fn get_by_pwd_reset_token(token: &str) -> anyhow::Result<User> {
if token.is_empty() { if token.is_empty() {
return Err(anyhow::Error::from(std::io::Error::other( return Err(anyhow::Error::from(std::io::Error::new(
ErrorKind::Other,
"Token is empty!", "Token is empty!",
))); )));
} }
@ -44,7 +46,8 @@ pub async fn get_by_pwd_reset_token(token: &str) -> anyhow::Result<User> {
/// Get the information of a user, by its account deletion token /// Get the information of a user, by its account deletion token
pub async fn get_by_account_delete_token(token: &str) -> anyhow::Result<User> { pub async fn get_by_account_delete_token(token: &str) -> anyhow::Result<User> {
if token.is_empty() { if token.is_empty() {
return Err(anyhow::Error::from(std::io::Error::other( return Err(anyhow::Error::from(std::io::Error::new(
ErrorKind::Other,
"Token is empty!", "Token is empty!",
))); )));
} }