1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[KeyConnector] Add support for key connector OTP (#1256)

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
This commit is contained in:
Oscar Hinton
2021-11-09 19:24:26 +01:00
committed by GitHub
parent e5eb5d61fe
commit db5a8df64e
46 changed files with 473 additions and 250 deletions

View File

@@ -6,6 +6,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserVerificationService } from 'jslib-common/abstractions/userVerification.service';
import { UpdateTwoFactorYubioOtpRequest } from 'jslib-common/models/request/updateTwoFactorYubioOtpRequest';
import { TwoFactorYubiKeyResponse } from 'jslib-common/models/response/twoFactorYubiKeyResponse';
@@ -28,8 +29,8 @@ export class TwoFactorYubiKeyComponent extends TwoFactorBaseComponent {
constructor(apiService: ApiService, i18nService: I18nService,
toasterService: ToasterService, platformUtilsService: PlatformUtilsService,
logService: LogService) {
super(apiService, i18nService, toasterService, platformUtilsService, logService);
logService: LogService, userVerificationService: UserVerificationService) {
super(apiService, i18nService, toasterService, platformUtilsService, logService, userVerificationService);
}
auth(authResponse: any) {
@@ -37,9 +38,8 @@ export class TwoFactorYubiKeyComponent extends TwoFactorBaseComponent {
this.processResponse(authResponse.response);
}
submit() {
const request = new UpdateTwoFactorYubioOtpRequest();
request.masterPasswordHash = this.masterPasswordHash;
async submit() {
const request = await this.buildRequestModel(UpdateTwoFactorYubioOtpRequest);
request.key1 = this.keys != null && this.keys.length > 0 ? this.keys[0].key : null;
request.key2 = this.keys != null && this.keys.length > 1 ? this.keys[1].key : null;
request.key3 = this.keys != null && this.keys.length > 2 ? this.keys[2].key : null;