mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-08-29 06:16:34 +02:00
Refactor user password update logic: Only update password and token if a new password is provided. Update frontend to conditionally include password in the request data, improving user experience and data handling.
Fix: https://github.com/usmannasir/cyberpanel/issues/1509
This commit is contained in:
@@ -305,11 +305,15 @@ app.controller('modifyUser', function ($scope, $http) {
|
||||
firstName: firstName,
|
||||
lastName: lastName,
|
||||
email: email,
|
||||
passwordByPass: password,
|
||||
securityLevel: $scope.securityLevel,
|
||||
twofa: $scope.twofa
|
||||
};
|
||||
|
||||
// Only include password if it's provided and not empty
|
||||
if (password && password.trim()) {
|
||||
data.passwordByPass = password;
|
||||
}
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
|
||||
Reference in New Issue
Block a user