mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Only the username form control should be emitted (#3333)
This commit is contained in:
committed by
Eugenio Romano
parent
3f9dc53722
commit
0ebd4c62e3
@@ -571,4 +571,16 @@ describe('LoginComponent', () => {
|
||||
|
||||
loginWithCredentials('fake-username', 'fake-password', null);
|
||||
}));
|
||||
|
||||
it('should emit only the username and not the password as part of the executeSubmit', async(() => {
|
||||
component.executeSubmit.subscribe((res) => {
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(res.values.controls.username).toBeDefined('username mandatory');
|
||||
expect(res.values.controls.username.value).toEqual('fake-username');
|
||||
expect(res.values.controls.password).toBeUndefined('The password not not be part of the emitted values');
|
||||
});
|
||||
|
||||
loginWithCredentials('fake-username', 'fake-password');
|
||||
}));
|
||||
});
|
||||
|
@@ -174,8 +174,7 @@ export class LoginComponent implements OnInit {
|
||||
this.settingsService.csrfDisabled = this.disableCsrf;
|
||||
|
||||
this.disableError();
|
||||
|
||||
const args = new LoginSubmitEvent(this.form);
|
||||
const args = new LoginSubmitEvent({controls : { username : this.form.controls.username} });
|
||||
this.executeSubmit.emit(args);
|
||||
|
||||
if (args.defaultPrevented) {
|
||||
|
Reference in New Issue
Block a user