From 3c68fb0876efb80a0a1bb8302fdc645945f98262 Mon Sep 17 00:00:00 2001 From: rr-bw <102181210+rr-bw@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:05:46 -0700 Subject: [PATCH] handle browser/desktop syncService --- .../src/auth/popup/login/extension-login.service.ts | 3 +++ libs/auth/src/angular/login/login.component.ts | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 apps/browser/src/auth/popup/login/extension-login.service.ts diff --git a/apps/browser/src/auth/popup/login/extension-login.service.ts b/apps/browser/src/auth/popup/login/extension-login.service.ts new file mode 100644 index 0000000000..b93ce72c9d --- /dev/null +++ b/apps/browser/src/auth/popup/login/extension-login.service.ts @@ -0,0 +1,3 @@ +import { DefaultLoginService, LoginService } from "@bitwarden/auth/angular"; + +export class ExtensionLoginService extends DefaultLoginService implements LoginService {} diff --git a/libs/auth/src/angular/login/login.component.ts b/libs/auth/src/angular/login/login.component.ts index ecefee18ee..75afd81dd4 100644 --- a/libs/auth/src/angular/login/login.component.ts +++ b/libs/auth/src/angular/login/login.component.ts @@ -24,6 +24,7 @@ import { EnvironmentService } from "@bitwarden/common/platform/abstractions/envi import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; +import { SyncService } from "@bitwarden/common/platform/sync"; import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength"; import { UserId } from "@bitwarden/common/types/guid"; import { @@ -104,6 +105,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy { private policyService: InternalPolicyService, private registerRouteService: RegisterRouteService, private router: Router, + private syncService: SyncService, private toastService: ToastService, ) { this.clientType = this.platformUtilsService.getClientType(); @@ -166,8 +168,11 @@ export class LoginComponentV2 implements OnInit, OnDestroy { this.loginEmailService.clearValues(); await this.router.navigate(["update-temp-password"]); } else { - // TODO-rr-bw: handle desktop specific - // TODO-rr-bw: handle browser specific + // Browser/Desktop specific (start) + if (this.clientType === ClientType.Browser || this.clientType === ClientType.Desktop) { + await this.syncService.fullSync(true); // TODO-rr-bw: check -> browser uses `await` and desktop uses `return`. Why? + } + // Browser/Desktop specific (end) // Web specific (start) await this.goAfterLogIn(response.userId);