From 4012a6c594061b731acbdceb8053775532222ae1 Mon Sep 17 00:00:00 2001 From: rr-bw <102181210+rr-bw@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:54:13 -0700 Subject: [PATCH] ensure full sync happens on all clients before navigation --- libs/auth/src/angular/login/login.component.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/auth/src/angular/login/login.component.ts b/libs/auth/src/angular/login/login.component.ts index b1f59af15d..78d81f3ac3 100644 --- a/libs/auth/src/angular/login/login.component.ts +++ b/libs/auth/src/angular/login/login.component.ts @@ -224,8 +224,6 @@ export class LoginComponentV2 implements OnInit, OnDestroy { * @returns A simple `return` statement for each conditional check. * If you update this method, do not forget to add a `return` * to each if-condition block where necessary to stop code execution. - * - * TODO-rr-bw: is using returns a good approach, or should we stick with is/else if/else? */ private async handleAuthResult(authResult: AuthResult): Promise { if (this.handleCaptchaRequired(authResult)) { @@ -254,6 +252,8 @@ export class LoginComponentV2 implements OnInit, OnDestroy { return; } + await this.syncService.fullSync(true); + if (authResult.forcePasswordReset != ForceSetPasswordReason.None) { this.loginEmailService.clearValues(); await this.router.navigate(["update-temp-password"]); @@ -268,7 +268,6 @@ export class LoginComponentV2 implements OnInit, OnDestroy { // ...on Browser/Desktop } else { - await this.syncService.fullSync(true); // TODO-rr-bw: browser used `await`, desktop used `return`. Why? Does it matter? this.loginEmailService.clearValues(); if (this.clientType === ClientType.Browser) {