summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods/startAssertion.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2020-05-25 11:50:22 -0700
committerGitHub <noreply@github.com>2020-05-25 11:50:22 -0700
commitd0205b9a4f2b4e304447e8072e4384f52dcc0c51 (patch)
treef68fe8f67d53efb6faa84d8e35c25a65b315507a /packages/browser/src/methods/startAssertion.ts
parent2cda08e3fc9935eff5613f08c7f9e4a30cf19c85 (diff)
parent5ef053d8785afc0cc25936add1b9b9097efbe45e (diff)
Merge pull request #10 from MasterKale/feature/linting
feature/linting
Diffstat (limited to 'packages/browser/src/methods/startAssertion.ts')
-rw-r--r--packages/browser/src/methods/startAssertion.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/browser/src/methods/startAssertion.ts b/packages/browser/src/methods/startAssertion.ts
index 0733194..f504f19 100644
--- a/packages/browser/src/methods/startAssertion.ts
+++ b/packages/browser/src/methods/startAssertion.ts
@@ -15,7 +15,7 @@ import supportsWebauthn from '../helpers/supportsWebauthn';
* @param requestOptionsJSON Output from @webauthntine/server's generateAssertionOptions(...)
*/
export default async function startAssertion(
- requestOptionsJSON: PublicKeyCredentialRequestOptionsJSON
+ requestOptionsJSON: PublicKeyCredentialRequestOptionsJSON,
): Promise<AuthenticatorAssertionResponseJSON> {
if (!supportsWebauthn()) {
throw new Error('WebAuthn is not supported in this browser');
@@ -25,16 +25,16 @@ export default async function startAssertion(
const publicKey: PublicKeyCredentialRequestOptions = {
...requestOptionsJSON.publicKey,
challenge: toUint8Array(requestOptionsJSON.publicKey.challenge),
- allowCredentials: requestOptionsJSON.publicKey.allowCredentials.map((cred) => {
+ allowCredentials: requestOptionsJSON.publicKey.allowCredentials.map(cred => {
// Make sure the credential ID length is a multiple of 4
- const padLength = 4 - cred.id.length % 4;
- let id = cred.id.padEnd(cred.id.length + padLength, '=');
+ const padLength = 4 - (cred.id.length % 4);
+ const id = cred.id.padEnd(cred.id.length + padLength, '=');
return {
...cred,
id: base64js.toByteArray(id),
};
- })
+ }),
};
// Wait for the user to complete assertion
@@ -44,7 +44,7 @@ export default async function startAssertion(
throw new Error('Assertion was not completed');
}
- const { response } = (credential as AssertionCredential);
+ const { response } = credential as AssertionCredential;
let base64UserHandle = undefined;
if (response.userHandle) {