mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
refactor: socket profile update to use api lib
This commit is contained in:
@@ -27,7 +27,7 @@ usersAPI.update = async function (caller, data) {
|
||||
]);
|
||||
|
||||
// Changing own email/username requires password confirmation
|
||||
if (caller.uid === targetUid && !passwordMatch) {
|
||||
if (['email', 'username'].some(prop => Object.keys(data).includes(prop)) && !isAdminOrGlobalMod && caller.uid === targetUid && !passwordMatch) {
|
||||
throw new Error('[[error:invalid-password]]');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user