summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods/startAssertion.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2020-05-25 11:11:48 -0700
committerMatthew Miller <matthew@millerti.me>2020-05-25 11:11:48 -0700
commitce486db665fd805fff59772dfc852ac2d4cb3a43 (patch)
treea727ea2d928d50cc576bd150d08cc4de679e22f5 /packages/browser/src/methods/startAssertion.ts
parent279723fc1cb10e653431a9d7dbe3592f760b3c8b (diff)
Run Prettier over everything
Diffstat (limited to 'packages/browser/src/methods/startAssertion.ts')
-rw-r--r--packages/browser/src/methods/startAssertion.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/browser/src/methods/startAssertion.ts b/packages/browser/src/methods/startAssertion.ts
index 0733194..36c7194 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;
+ const padLength = 4 - (cred.id.length % 4);
let 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) {