diff --git a/src/service/user.rs b/src/service/user.rs index d7c5180..5e2a5f7 100644 --- a/src/service/user.rs +++ b/src/service/user.rs @@ -6,18 +6,14 @@ use crate::domain::token::Token; use crate::domain::user::User; use crate::dto::token::{AuthenticateUserDto, RefreshAuthTokenForUserDto}; use crate::dto::users::{UserLoginPayload, UserRegisterPayload, UserResetPasswordPayload}; -use crate::resources::error_messages::{ - ErrorResource, ERROR_CREDENTIAL_DOES_NOT_EXIST, ERROR_EXPIRED_TOKEN, ERROR_INCORRECT_TOKEN, - ERROR_PASSWORD_INCORRECT, ERROR_TOKEN_NOT_CREATED, ERROR_TOO_MANY_CREDENTIALS, - ERROR_USER_ALREADY_EXISTS, ERROR_USER_DOES_NOT_EXIST, -}; + use crate::resources::expirations::AUTH_TOKEN_EXPIRATION_TIME_MILLIS; use crate::utils::hasher::{ generate_multiple_random_token_with_rng, hash_password, hash_password_with_existing_salt, }; use crate::validation::user_validator::validate_user_for_creation; use chrono::Utc; -use log::{debug, error}; +use log::{error}; use sqlx::{PgConnection, Postgres, Transaction}; use crate::domain::error::{Error, ValidationError}; use crate::domain::error::Error::{AlreadyExistsError, IncorrectCredentialError, NotFoundError, TooManyCredentialsError, UnexpectedError}; diff --git a/src/validation/user_validator.rs b/src/validation/user_validator.rs index 25b8ee8..440184f 100644 --- a/src/validation/user_validator.rs +++ b/src/validation/user_validator.rs @@ -53,6 +53,7 @@ pub(crate) fn validate_user_for_creation( error_resources.push(ValidationError { what: String::from("Password"), reason: ERROR_INVALID_PASSWORD.0.to_string() }); } } +#[allow(unused)] pub(crate) fn validate_user_for_password_authentication( user: &UserLoginPayload, error_resources: &mut Vec,