From: Dnyaneshwari Talwekar Date: Tue, 21 Jul 2026 05:36:26 +0000 (+0530) Subject: mgr/dashboard: New dashboard user creation is successful with long characters > 256... X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F70361%2Fhead;p=ceph.git mgr/dashboard: New dashboard user creation is successful with long characters > 256 but login fails Signed-off-by: Dnyaneshwari Talwekar Fixes: https://tracker.ceph.com/issues/78439 --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.html index e0e28e9b2340..d7c779eb1b4a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.html @@ -32,6 +32,7 @@ i18n-placeholder id="username" formControlName="username" + maxlength="256" [invalid]="!userForm.controls.username.valid && userForm.controls.username.dirty" autofocus ngbTooltip="White spaces at the beginning and end will be trimmed" @@ -43,6 +44,9 @@ This field is required. + + Username must not exceed 256 characters. + The username already exists. diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts index 12fb843692d7..e7b9c8ea9b5e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts @@ -90,7 +90,11 @@ export class UserFormComponent extends CdForm implements OnInit { { username: [ '', - [Validators.required, Validators.pattern(DASHBOARD_USERNAME_PATTERN)], + [ + Validators.required, + Validators.pattern(DASHBOARD_USERNAME_PATTERN), + Validators.maxLength(256) + ], [CdValidators.unique(this.userService.validateUserName, this.userService)] ], name: [''],