This commit is contained in:
JMARyA 2024-09-11 11:30:05 +02:00
parent edfb2da790
commit abaa9f12c9
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 114 additions and 105 deletions

View file

@ -69,7 +69,7 @@ pub struct PasswdData {
}
#[post("/passwd", data = "<passwd>")]
pub async fn passwd_route(passwd: Json<PasswdData>, mut u: User) -> FallibleApiResponse {
pub async fn passwd_route(passwd: Json<PasswdData>, u: User) -> FallibleApiResponse {
u.passwd(&passwd.old, &passwd.new)
.await
.map_err(|()| api_error("Password change failed"))?;