mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Remove hardcode banned user
This commit is contained in:
@@ -11,6 +11,10 @@
|
|||||||
<span class="mdl-switch__label">BPM</span>
|
<span class="mdl-switch__label">BPM</span>
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
|
<p style="width:130px;margin: 10px;">
|
||||||
|
<label for="blacklistusername">Banned username</label><br>
|
||||||
|
<input id="blacklistusername" type="text" placeholder="banned username" [(ngModel)]="blackListUsername" />
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<alfresco-login [providers]="providers" [fieldsValidation]="customValidation"
|
<alfresco-login [providers]="providers" [fieldsValidation]="customValidation"
|
||||||
(executeSubmit)="validateForm($event)"
|
(executeSubmit)="validateForm($event)"
|
||||||
|
@@ -35,6 +35,7 @@ export class LoginDemoComponent implements OnInit {
|
|||||||
alfrescologin: any;
|
alfrescologin: any;
|
||||||
|
|
||||||
providers: string = 'ECM';
|
providers: string = 'ECM';
|
||||||
|
blackListUsername: string;
|
||||||
customValidation: any;
|
customValidation: any;
|
||||||
|
|
||||||
constructor(public router: Router) {
|
constructor(public router: Router) {
|
||||||
@@ -86,7 +87,7 @@ export class LoginDemoComponent implements OnInit {
|
|||||||
|
|
||||||
validateForm(event: any) {
|
validateForm(event: any) {
|
||||||
let values = event.values;
|
let values = event.values;
|
||||||
if (values.controls['username'].value === 'invalidUsername') {
|
if (values.controls['username'].value === this.blackListUsername ) {
|
||||||
this.alfrescologin.addCustomFormError('username', 'This particular username has been blocked');
|
this.alfrescologin.addCustomFormError('username', 'This particular username has been blocked');
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user