From 91abb0e70f2c965b28cf35bac5b7d7049a7656bc Mon Sep 17 00:00:00 2001 From: Pedro Gonzalez Gomez Date: Thu, 21 Mar 2024 08:56:58 +0100 Subject: [PATCH] mgr/dashboard: sanitize dashboard user creation Fixes: https://tracker.ceph.com/issues/65030 Signed-off-by: Pedro Gonzalez Gomez (cherry picked from commit 9951a3a7f314c7cd1eb147fb1b398ac6c5212806) --- .../mgr/dashboard/frontend/src/app/core/auth/auth.module.ts | 5 +++-- .../src/app/core/auth/user-form/user-form.component.html | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/auth.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/auth.module.ts index 74583431c97a8..eedcdd686021d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/auth.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/auth.module.ts @@ -3,7 +3,7 @@ import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { RouterModule, Routes } from '@angular/router'; -import { NgbNavModule, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgbModule, NgbNavModule, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'; import { NgxPipeFunctionModule } from 'ngx-pipe-function'; import { ActionLabels, URLVerbs } from '~/app/shared/constants/app.constants'; @@ -27,7 +27,8 @@ import { UserTabsComponent } from './user-tabs/user-tabs.component'; NgbNavModule, NgbPopoverModule, NgxPipeFunctionModule, - RouterModule + RouterModule, + NgbModule ], declarations: [ LoginComponent, 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 ddb0e6ab8aeb6..4169d54c39fa4 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 @@ -23,7 +23,10 @@ name="username" formControlName="username" autocomplete="off" - autofocus> + autofocus + ngbTooltip="White spaces at the beginning and end will be trimmed" + i18n-ngbTooltip + cdTrim> This field is required. -- 2.39.5