diff --git a/src/lib/components/mfaChallengeFormList.svelte b/src/lib/components/mfaChallengeFormList.svelte index b1d270d5a..d6552eccb 100644 --- a/src/lib/components/mfaChallengeFormList.svelte +++ b/src/lib/components/mfaChallengeFormList.svelte @@ -7,7 +7,7 @@ ); } - if ((code = 'webauthn')) { + if (code == 'webauthn') { await sdk.forConsole.webauthnAccount.createMfaWebauthnChallengeHelper(); } else { await sdk.forConsole.account.updateMfaChallenge(challenge.$id, code); diff --git a/src/lib/sdk/account.ts b/src/lib/sdk/account.ts index 24664334c..d13c25453 100644 --- a/src/lib/sdk/account.ts +++ b/src/lib/sdk/account.ts @@ -15,7 +15,7 @@ export type WebauthnRegisterChallenge = { displayName: string; }; challenge: string; - pubKeyCredParams: any; + pubKeyCredParams: object; timeout: number; }; @@ -78,10 +78,10 @@ export class Account { } async createMfaWebauthnAuthenticatorHelper() { - let challenge = await this.createMfaWebauthnAuthenticator(); + const challenge = await this.createMfaWebauthnAuthenticator(); //TODO Replace with native navigator.credentials.create - let credential = await startRegistration(challenge); + const credential = await startRegistration(challenge); await this.completeWebauthnMfaAuthenticator(credential); } @@ -113,10 +113,10 @@ export class Account { } async createMfaWebauthnChallengeHelper() { - let challenge = await this.createMfaWebauthnChallenge(); + const challenge = await this.createMfaWebauthnChallenge(); //TODO Replace with native navigator.credentials.create - let credential = await startAuthentication(challenge); + const credential = await startAuthentication(challenge); await this.completeMfaWebauthnChallenge(challenge.$id, credential); } @@ -130,7 +130,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + path); - let body = {}; + const body = {}; if (challengeId) { body['challengeId'] = challengeId; @@ -155,9 +155,9 @@ export class Account { } async deleteMfaWebauthnAuthenticatorHelper() { - let challenge = await this.createMfaWebauthnChallenge(); + const challenge = await this.createMfaWebauthnChallenge(); - let credential = await startAuthentication(challenge); + const credential = await startAuthentication(challenge); await this.deleteMfaWebauthnAuthenticator(challenge.$id, credential); }