summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src/assertion/verifyAssertionResponse.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/server/src/assertion/verifyAssertionResponse.ts')
-rw-r--r--packages/server/src/assertion/verifyAssertionResponse.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/packages/server/src/assertion/verifyAssertionResponse.ts b/packages/server/src/assertion/verifyAssertionResponse.ts
index 4441428..a4831aa 100644
--- a/packages/server/src/assertion/verifyAssertionResponse.ts
+++ b/packages/server/src/assertion/verifyAssertionResponse.ts
@@ -46,13 +46,6 @@ export default function verifyAssertionResponse(
throw new Error('User was NOT present during assertion!');
}
- const {
- rpIdHash,
- flagsBuf,
- counterBuf,
- counter,
- } = authData;
-
if (counter <= authenticator.counter) {
// Error out when the counter in the DB is greater than or equal to the counter in the
// dataStruct. It's related to how the authenticator maintains the number of times its been
@@ -63,6 +56,12 @@ export default function verifyAssertionResponse(
);
}
+ const {
+ rpIdHash,
+ flagsBuf,
+ counterBuf,
+ } = authDataStruct;
+
const clientDataHash = toHash(base64url.toBuffer(base64ClientDataJSON));
const signatureBase = Buffer.concat([
rpIdHash,