visual changes

This commit is contained in:
Mateusz Gruszczyński
2026-07-28 09:17:13 +02:00
parent a27f8ad7f3
commit 351dd081b5
13 changed files with 309 additions and 127 deletions
+1
View File
@@ -20,6 +20,7 @@ const MODULES: &[&str] = &[
"note-files",
"session",
"socket",
"toast",
"url-state",
"security",
];
+14 -4
View File
@@ -650,10 +650,20 @@ pub async fn update_profile(
"E-mail and password are managed by LDAP/AD.",
));
}
} else if !verify_password(&user.password_hash, &req.password) {
return Err(AuthError::unauthorized(
"The current password is incorrect.",
));
} else {
let changes_credentials = req
.new_email
.as_deref()
.is_some_and(|value| !value.trim().is_empty())
|| req
.new_password
.as_deref()
.is_some_and(|value| !value.is_empty());
if changes_credentials && !verify_password(&user.password_hash, &req.password) {
return Err(AuthError::unauthorized(
"The current password is incorrect.",
));
}
}
let mut nickname = user.nickname.clone();