From f19ade65d30dbbce0a2144edd419906188dc2104 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Thu, 22 Feb 2018 14:43:12 +0000 Subject: [PATCH] remove password from login success event --- lib/core/login/components/login.component.spec.ts | 4 ++-- lib/core/login/components/login.component.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/core/login/components/login.component.spec.ts b/lib/core/login/components/login.component.spec.ts index 3364f3c7d7..72b5e044b1 100644 --- a/lib/core/login/components/login.component.spec.ts +++ b/lib/core/login/components/login.component.spec.ts @@ -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) ); }); diff --git a/lib/core/login/components/login.component.ts b/lib/core/login/components/login.component.ts index 0787234197..7f6cd903a3 100644 --- a/lib/core/login/components/login.component.ts +++ b/lib/core/login/components/login.component.ts @@ -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);