Skip to content

Commit

Permalink
adjust user modification logic
Browse files Browse the repository at this point in the history
  • Loading branch information
huangcheng committed Dec 2, 2023
1 parent f71835b commit d3a816d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/handlers/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ pub async fn update_user(
.fetch_one(&mut ***db)
.await?;

if !verify(user.password, &record.password).unwrap() {
return Err(ServiceError::Unauthorized);
}

let username = match user.username {
Some(username) => String::from(username),
None => record.username,
Expand Down
1 change: 0 additions & 1 deletion src/request/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use serde::Deserialize;
#[derive(Debug, Deserialize)]
pub struct UpdateUser<'r> {
pub username: Option<&'r str>,
pub password: &'r str,
pub email: Option<&'r str>,
pub avatar: Option<&'r str>,
pub nickname: Option<&'r str>,
Expand Down

0 comments on commit d3a816d

Please sign in to comment.