Update password #6
@@ -320,9 +320,11 @@ pub mod endpoint {
|
|||||||
|
|
||||||
if !payload.is_valid() {
|
if !payload.is_valid() {
|
||||||
response.message = "Invalid request".to_string();
|
response.message = "Invalid request".to_string();
|
||||||
|
println!("Invalid request");
|
||||||
return (axum::http::StatusCode::BAD_REQUEST, axum::Json(response));
|
return (axum::http::StatusCode::BAD_REQUEST, axum::Json(response));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
println!("Get User");
|
||||||
match repo::user::get(&pool, &payload.username).await {
|
match repo::user::get(&pool, &payload.username).await {
|
||||||
Ok(user) => {
|
Ok(user) => {
|
||||||
if hashing::verify_password(&payload.current_password, user.password.clone())
|
if hashing::verify_password(&payload.current_password, user.password.clone())
|
||||||
|
|||||||
Reference in New Issue
Block a user