From 2f03b788a40060873849ba3fe8e3dbdfb1378dbd Mon Sep 17 00:00:00 2001 From: Nick Funk Date: Wed, 10 Jun 2020 17:36:56 -0600 Subject: [PATCH] [CORL-1121] Remove username validation when updated by admin (#2986) * Use SSO validation for updateUserUsername CORL-1121 * Remove validation on admin-only user rename We don't need to validate the user-name as only admin's will be using this mutator. If they're updating things incorrectly, that's up to them to manage with this flow. CORL-1121 --- src/core/server/services/users/helpers.ts | 1 - src/core/server/services/users/users.ts | 3 --- 2 files changed, 4 deletions(-) diff --git a/src/core/server/services/users/helpers.ts b/src/core/server/services/users/helpers.ts index 1dd793d38..c65d07a2d 100644 --- a/src/core/server/services/users/helpers.ts +++ b/src/core/server/services/users/helpers.ts @@ -5,7 +5,6 @@ import { USERNAME_MIN_LENGTH, USERNAME_REGEX, } from "coral-common/helpers/validate"; - import { EmailExceedsMaxLengthError, EmailInvalidFormatError, diff --git a/src/core/server/services/users/users.ts b/src/core/server/services/users/users.ts index d836ec0df..85e095459 100644 --- a/src/core/server/services/users/users.ts +++ b/src/core/server/services/users/users.ts @@ -630,9 +630,6 @@ export async function updateUsernameByID( username: string, createdBy: User ) { - // Validate the username. - validateUsername(username); - return updateUserUsername(mongo, tenant.id, userID, username, createdBy.id); }