1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

move sync to post login action

This commit is contained in:
Kyle Spearrin
2018-04-25 12:08:18 -04:00
parent 31bd1f9423
commit 05e6d2c0f0
2 changed files with 11 additions and 5 deletions

View File

@@ -16,13 +16,14 @@ export class LoginComponent {
masterPassword: string = '';
showPassword: boolean = false;
formPromise: Promise<AuthResult>;
onSuccessfullLogin: () => Promise<any>;
protected twoFactorRoute = '2fa';
protected successRoute = 'vault';
constructor(protected authService: AuthService, protected router: Router,
protected analytics: Angulartics2, protected toasterService: ToasterService,
protected i18nService: I18nService, protected syncService: SyncService) { }
protected i18nService: I18nService) { }
async submit() {
if (this.email == null || this.email === '') {
@@ -48,7 +49,9 @@ export class LoginComponent {
this.analytics.eventTrack.next({ action: 'Logged In To Two-step' });
this.router.navigate([this.twoFactorRoute]);
} else {
this.syncService.fullSync(true);
if (this.onSuccessfullLogin != null) {
this.onSuccessfullLogin();
}
this.analytics.eventTrack.next({ action: 'Logged In' });
this.router.navigate([this.successRoute]);
}