Tweaked user file for warning and set err to path
This commit is contained in:
parent
c784889623
commit
55b1ad0029
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -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",
|
||||
|
@ -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" }
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user