Skip to content

Commit d3ec86a

Browse files
authored
Merge pull request ceph#56357 from rhcs-dashboard/sanitize-users-form
mgr/dashboard: sanitize dashboard user creation Reviewed-by: Ankush Behl <[email protected]> Reviewed-by: Nizamudeen A <[email protected]>
2 parents 9cd0f81 + 9951a3a commit d3ec86a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/pybind/mgr/dashboard/frontend/src/app/core/auth/auth.module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { NgModule } from '@angular/core';
33
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
44
import { RouterModule, Routes } from '@angular/router';
55

6-
import { NgbNavModule, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
6+
import { NgbModule, NgbNavModule, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
77
import { NgxPipeFunctionModule } from 'ngx-pipe-function';
88

99
import { ActionLabels, URLVerbs } from '~/app/shared/constants/app.constants';
@@ -27,7 +27,8 @@ import { UserTabsComponent } from './user-tabs/user-tabs.component';
2727
NgbNavModule,
2828
NgbPopoverModule,
2929
NgxPipeFunctionModule,
30-
RouterModule
30+
RouterModule,
31+
NgbModule
3132
],
3233
declarations: [
3334
LoginComponent,

src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
name="username"
2424
formControlName="username"
2525
autocomplete="off"
26-
autofocus>
26+
autofocus
27+
ngbTooltip="White spaces at the beginning and end will be trimmed"
28+
i18n-ngbTooltip
29+
cdTrim>
2730
<span class="invalid-feedback"
2831
*ngIf="userForm.showError('username', formDir, 'required')"
2932
i18n>This field is required.</span>

0 commit comments

Comments
 (0)