summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/server/src')
-rw-r--r--packages/server/src/authentication/verifyAuthenticationResponse.test.ts13
-rw-r--r--packages/server/src/registration/verifyRegistrationResponse.test.ts12
2 files changed, 25 insertions, 0 deletions
diff --git a/packages/server/src/authentication/verifyAuthenticationResponse.test.ts b/packages/server/src/authentication/verifyAuthenticationResponse.test.ts
index 57d9613..1273e89 100644
--- a/packages/server/src/authentication/verifyAuthenticationResponse.test.ts
+++ b/packages/server/src/authentication/verifyAuthenticationResponse.test.ts
@@ -308,6 +308,19 @@ test('should fail verification if custom challenge verifier returns false', () =
}).toThrow(/custom challenge verifier returned false/i);
});
+test('should return credential backup info', async () => {
+ const verification = verifyAuthenticationResponse({
+ credential: assertionResponse,
+ expectedChallenge: assertionChallenge,
+ expectedOrigin: assertionOrigin,
+ expectedRPID: 'dev.dontneeda.pw',
+ authenticator: authenticator,
+ });
+
+ expect(verification.authenticationInfo?.credentialDeviceType).toEqual('singleDevice');
+ expect(verification.authenticationInfo?.credentialBackedUp).toEqual(false);
+});
+
/**
* Assertion examples below
*/
diff --git a/packages/server/src/registration/verifyRegistrationResponse.test.ts b/packages/server/src/registration/verifyRegistrationResponse.test.ts
index f9074cc..03f74ef 100644
--- a/packages/server/src/registration/verifyRegistrationResponse.test.ts
+++ b/packages/server/src/registration/verifyRegistrationResponse.test.ts
@@ -568,6 +568,18 @@ test('should fail verification if custom challenge verifier returns false', asyn
).rejects.toThrow(/custom challenge verifier returned false/i);
});
+test('should return credential backup info', async () => {
+ const verification = await verifyRegistrationResponse({
+ credential: attestationNone,
+ expectedChallenge: attestationNoneChallenge,
+ expectedOrigin: 'https://dev.dontneeda.pw',
+ expectedRPID: 'dev.dontneeda.pw',
+ });
+
+ expect(verification.registrationInfo?.credentialDeviceType).toEqual('singleDevice');
+ expect(verification.registrationInfo?.credentialBackedUp).toEqual(false);
+});
+
/**
* Various Attestations Below
*/