[SSO] Set Password flow sync (#159)

* Added sync service to set-password // Added error for CLI in set-password flow

* Updated error string // added sync tracking boolean

* VS code failed to saved latest change - resaving false loading
This commit is contained in:
Vincent Salucci 2020-08-27 13:24:38 -05:00 committed by GitHub
parent e07526a1b6
commit 42d5784ef3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -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();

View File

@ -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);