remove password from login success event

This commit is contained in:
Eugenio Romano
2018-02-22 14:43:12 +00:00
parent 6e14ff5470
commit f19ade65d3
2 changed files with 4 additions and 3 deletions

View File

@@ -501,7 +501,7 @@ describe('LoginComponent', () => {
loginWithCredentials('fake-username-ECM-access-error', 'fake-password');
}));
it('should emit success event after the login has succeeded', async(() => {
it('should emit success event after the login has succeeded and discard password', async(() => {
component.providers = 'ECM';
component.success.subscribe((event) => {
@@ -509,7 +509,7 @@ describe('LoginComponent', () => {
expect(component.isError).toBe(false);
expect(event).toEqual(
new LoginSuccessEvent({type: 'type', ticket: 'ticket'}, 'fake-username', 'fake-password')
new LoginSuccessEvent({type: 'type', ticket: 'ticket'}, 'fake-username', null)
);
});

View File

@@ -217,7 +217,8 @@ export class LoginComponent implements OnInit {
this.actualLoginStep = LoginSteps.Welcome;
this.userPreferences.setStoragePrefix(values.username);
this.success.emit(new LoginSuccessEvent(token, values.username, values.password));
values.password = '';
this.success.emit(new LoginSuccessEvent(token, values.username));
if (redirectUrl) {
this.authService.setRedirectUrl(null);