add a way for admins to set username when profiles are locked

This commit is contained in:
Girish Ramakrishnan
2022-01-12 16:20:10 -08:00
parent ded5db20e6
commit 4513b6de70
3 changed files with 3 additions and 0 deletions
+1
View File
@@ -546,6 +546,7 @@ async function update(user, data, auditSource) {
if (_.isEmpty(data)) return;
if (data.username) {
if (user.username) throw new BoxError(BoxError.BAD_FIELD, 'Username cannot be changed');
data.username = data.username.toLowerCase();
error = validateUsername(data.username);
if (error) throw error;