summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods/startAssertion.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/browser/src/methods/startAssertion.ts')
-rw-r--r--packages/browser/src/methods/startAssertion.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/browser/src/methods/startAssertion.ts b/packages/browser/src/methods/startAssertion.ts
index 8e411ec..0733194 100644
--- a/packages/browser/src/methods/startAssertion.ts
+++ b/packages/browser/src/methods/startAssertion.ts
@@ -27,7 +27,8 @@ export default async function startAssertion(
challenge: toUint8Array(requestOptionsJSON.publicKey.challenge),
allowCredentials: requestOptionsJSON.publicKey.allowCredentials.map((cred) => {
// Make sure the credential ID length is a multiple of 4
- let id = cred.id.padEnd(cred.id.length + (cred.id.length % 4), '=');
+ const padLength = 4 - cred.id.length % 4;
+ let id = cred.id.padEnd(cred.id.length + padLength, '=');
return {
...cred,