Tweaked user file for warning and set err to path

This commit is contained in:
Franklin 2023-10-03 08:01:21 -04:00
parent c784889623
commit 55b1ad0029
3 changed files with 6 additions and 8 deletions

1
Cargo.lock generated
View File

@ -280,7 +280,6 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]]
name = "err"
version = "0.1.1"
source = "git+https://git.franklinblanco.dev/franklinblanco/err.git#18cc77b6266d0fc90237a7ccb297d3eeb574f78a"
dependencies = [
"serde",
"sqlx",

View File

@ -19,4 +19,4 @@ data-encoding = "2.3.2"
futures-util = "0.3"
log = "0.4.19"
err = { git = "https://git.franklinblanco.dev/franklinblanco/err.git" }
err = { path = "/Users/franklinblanco/Desktop/Code/rust/libs/dev-deps/err" }

View File

@ -15,7 +15,7 @@ use crate::validation::user_validator::validate_user_for_creation;
use chrono::Utc;
use err::{trace, Error, ErrorType, ServiceError, ValidationError, x_u_res_db_or_res, u_res_or_res};
use log::error;
use sqlx::{PgConnection, Postgres, Transaction};
use sqlx::PgConnection;
pub async fn register_user<'a>(
transaction: &mut PgConnection,
@ -144,9 +144,8 @@ pub async fn force_reset_password<'a>(
Ok(u_res_or_res!(change_password(conn, persisted_user, &new_password).await))
}
///
pub async fn password_login<'a>(
conn: &mut Transaction<'a, Postgres>,
pub async fn password_login(
conn: &mut PgConnection,
user: UserLoginPayload,
) -> Result<Token, Error> {
let persisted_user_credential = match x_u_res_db_or_res!(get_credential(conn, user.credential.clone()).await) {
@ -166,8 +165,8 @@ pub async fn password_login<'a>(
}
///
pub async fn get_user_credentials<'a>(
transaction: &mut Transaction<'a, Postgres>,
pub async fn get_user_credentials(
transaction: &mut PgConnection,
user: AuthenticateUserDto,
) -> Result<Vec<Credential>, Error> {
let persisted_user = u_res_or_res!(authenticate_user(transaction, user).await);