diff --git a/src/angular/components/set-password.component.ts b/src/angular/components/set-password.component.ts index 4bb1932967..94fe16326d 100644 --- a/src/angular/components/set-password.component.ts +++ b/src/angular/components/set-password.component.ts @@ -7,6 +7,7 @@ import { MessagingService } from '../../abstractions/messaging.service'; import { PasswordGenerationService } from '../../abstractions/passwordGeneration.service'; import { PlatformUtilsService } from '../../abstractions/platformUtils.service'; import { PolicyService } from '../../abstractions/policy.service'; +import { SyncService } from '../../abstractions/sync.service'; import { UserService } from '../../abstractions/user.service'; import { CipherString } from '../../models/domain/cipherString'; @@ -20,6 +21,7 @@ import { ChangePasswordComponent as BaseChangePasswordComponent } from './change import { KdfType } from '../../enums/kdfType'; export class SetPasswordComponent extends BaseChangePasswordComponent { + syncLoading: boolean = true; showPassword: boolean = false; hint: string = ''; @@ -29,11 +31,17 @@ export class SetPasswordComponent extends BaseChangePasswordComponent { constructor(i18nService: I18nService, cryptoService: CryptoService, messagingService: MessagingService, userService: UserService, passwordGenerationService: PasswordGenerationService, platformUtilsService: PlatformUtilsService, policyService: PolicyService, private router: Router, - private apiService: ApiService) { + private apiService: ApiService, private syncService: SyncService) { super(i18nService, cryptoService, messagingService, userService, passwordGenerationService, platformUtilsService, policyService); } + async ngOnInit() { + await this.syncService.fullSync(true); + this.syncLoading = false; + super.ngOnInit(); + } + async setupSubmitActions() { this.kdf = KdfType.PBKDF2_SHA256; const useLowerKdf = this.platformUtilsService.isEdge() || this.platformUtilsService.isIE(); diff --git a/src/cli/commands/login.command.ts b/src/cli/commands/login.command.ts index 9d6e6bf243..acccd4f4d2 100644 --- a/src/cli/commands/login.command.ts +++ b/src/cli/commands/login.command.ts @@ -200,6 +200,11 @@ export class LoginCommand { return Response.error('Login failed.'); } + if (response.resetMasterPassword) { + return Response.error('In order to log in with SSO from the CLI, you must first log in' + + ' through the web vault to set your master password.'); + } + if (this.success != null) { const res = await this.success(); return Response.success(res);