visual changes
This commit is contained in:
@@ -20,6 +20,7 @@ const MODULES: &[&str] = &[
|
||||
"note-files",
|
||||
"session",
|
||||
"socket",
|
||||
"toast",
|
||||
"url-state",
|
||||
"security",
|
||||
];
|
||||
|
||||
+14
-4
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user