mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-19 11:15:21 +01:00
[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:
parent
e07526a1b6
commit
42d5784ef3
@ -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();
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user