fix u2f params

This commit is contained in:
Kyle Spearrin 2018-07-21 00:26:16 -04:00
parent c1efe268d0
commit abdb40179c
1 changed files with 8 additions and 5 deletions

View File

@ -13,7 +13,10 @@ import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType'; import { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';
import { UpdateTwoFactorU2fRequest } from 'jslib/models/request/updateTwoFactorU2fRequest'; import { UpdateTwoFactorU2fRequest } from 'jslib/models/request/updateTwoFactorU2fRequest';
import { TwoFactorU2fResponse } from 'jslib/models/response/twoFactorU2fResponse'; import {
ChallengeResponse,
TwoFactorU2fResponse,
} from 'jslib/models/response/twoFactorU2fResponse';
import { TwoFactorBaseComponent } from './two-factor-base.component'; import { TwoFactorBaseComponent } from './two-factor-base.component';
@ -23,7 +26,7 @@ import { TwoFactorBaseComponent } from './two-factor-base.component';
}) })
export class TwoFactorU2fComponent extends TwoFactorBaseComponent implements OnInit, OnDestroy { export class TwoFactorU2fComponent extends TwoFactorBaseComponent implements OnInit, OnDestroy {
type = TwoFactorProviderType.U2f; type = TwoFactorProviderType.U2f;
u2fChallenge: any; u2fChallenge: ChallengeResponse;
u2fError: boolean; u2fError: boolean;
u2fListening: boolean; u2fListening: boolean;
u2fResponse: string; u2fResponse: string;
@ -88,9 +91,9 @@ export class TwoFactorU2fComponent extends TwoFactorBaseComponent implements OnI
this.u2fError = false; this.u2fError = false;
this.u2fListening = true; this.u2fListening = true;
(window as any).u2f.register(this.u2fChallenge.AppId, [{ (window as any).u2f.register(this.u2fChallenge.appId, [{
version: this.u2fChallenge.Version, version: this.u2fChallenge.version,
challenge: this.u2fChallenge.Challenge, challenge: this.u2fChallenge.challenge,
}], [], (data: any) => { }], [], (data: any) => {
this.u2fListening = false; this.u2fListening = false;
if (data.errorCode === 5) { if (data.errorCode === 5) {