From b3bd13fe2bbad26ea9d07d82ace958f466218403 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 13 Jul 2018 10:44:47 -0400 Subject: [PATCH] pass email param on login/register --- src/angular/components/login.component.ts | 13 +++++++++---- src/angular/components/register.component.ts | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/angular/components/login.component.ts b/src/angular/components/login.component.ts index 9b955dc36d..9e5557f9c3 100644 --- a/src/angular/components/login.component.ts +++ b/src/angular/components/login.component.ts @@ -27,7 +27,8 @@ export class LoginComponent implements OnInit { masterPassword: string = ''; showPassword: boolean = false; formPromise: Promise; - onSuccessfullLogin: () => Promise; + onSuccessfulLogin: () => Promise; + onSuccessfulLoginNavigate: () => Promise; protected twoFactorRoute = '2fa'; protected successRoute = 'vault'; @@ -82,11 +83,15 @@ export class LoginComponent implements OnInit { this.analytics.eventTrack.next({ action: 'Logged In To Two-step' }); this.router.navigate([this.twoFactorRoute]); } else { - if (this.onSuccessfullLogin != null) { - this.onSuccessfullLogin(); + if (this.onSuccessfulLogin != null) { + this.onSuccessfulLogin(); } this.analytics.eventTrack.next({ action: 'Logged In' }); - this.router.navigate([this.successRoute]); + if (this.onSuccessfulLoginNavigate != null) { + this.onSuccessfulLoginNavigate(); + } else { + this.router.navigate([this.successRoute]); + } } } catch { } } diff --git a/src/angular/components/register.component.ts b/src/angular/components/register.component.ts index a83c89f5f0..1650afd116 100644 --- a/src/angular/components/register.component.ts +++ b/src/angular/components/register.component.ts @@ -69,7 +69,7 @@ export class RegisterComponent { await this.formPromise; this.analytics.eventTrack.next({ action: 'Registered' }); this.toasterService.popAsync('success', null, this.i18nService.t('newAccountCreated')); - this.router.navigate([this.successRoute]); + this.router.navigate([this.successRoute], { queryParams: { email: this.email } }); } catch { } }