handle browser/desktop syncService

This commit is contained in:
rr-bw 2024-09-09 13:05:46 -07:00
parent 3636c72741
commit 3c68fb0876
No known key found for this signature in database
GPG Key ID: 3FA13C3ADEE51D5D
2 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1,3 @@
import { DefaultLoginService, LoginService } from "@bitwarden/auth/angular";
export class ExtensionLoginService extends DefaultLoginService implements LoginService {}

View File

@ -24,6 +24,7 @@ import { EnvironmentService } from "@bitwarden/common/platform/abstractions/envi
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { Utils } from "@bitwarden/common/platform/misc/utils"; import { Utils } from "@bitwarden/common/platform/misc/utils";
import { SyncService } from "@bitwarden/common/platform/sync";
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength"; import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
import { UserId } from "@bitwarden/common/types/guid"; import { UserId } from "@bitwarden/common/types/guid";
import { import {
@ -104,6 +105,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
private policyService: InternalPolicyService, private policyService: InternalPolicyService,
private registerRouteService: RegisterRouteService, private registerRouteService: RegisterRouteService,
private router: Router, private router: Router,
private syncService: SyncService,
private toastService: ToastService, private toastService: ToastService,
) { ) {
this.clientType = this.platformUtilsService.getClientType(); this.clientType = this.platformUtilsService.getClientType();
@ -166,8 +168,11 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
this.loginEmailService.clearValues(); this.loginEmailService.clearValues();
await this.router.navigate(["update-temp-password"]); await this.router.navigate(["update-temp-password"]);
} else { } else {
// TODO-rr-bw: handle desktop specific // Browser/Desktop specific (start)
// TODO-rr-bw: handle browser specific 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) // Web specific (start)
await this.goAfterLogIn(response.userId); await this.goAfterLogIn(response.userId);