mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Remove hardcode banned user
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
<span class="mdl-switch__label">BPM</span>
|
||||
</label>
|
||||
</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>
|
||||
<alfresco-login [providers]="providers" [fieldsValidation]="customValidation"
|
||||
(executeSubmit)="validateForm($event)"
|
||||
|
@@ -35,6 +35,7 @@ export class LoginDemoComponent implements OnInit {
|
||||
alfrescologin: any;
|
||||
|
||||
providers: string = 'ECM';
|
||||
blackListUsername: string;
|
||||
customValidation: any;
|
||||
|
||||
constructor(public router: Router) {
|
||||
@@ -86,7 +87,7 @@ export class LoginDemoComponent implements OnInit {
|
||||
|
||||
validateForm(event: any) {
|
||||
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');
|
||||
event.preventDefault();
|
||||
}
|
||||
|
Reference in New Issue
Block a user