summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src/authentication/verifyAuthenticationResponse.test.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2022-04-13 09:15:15 -0700
committerMatthew Miller <matthew@millerti.me>2022-05-15 21:49:33 -0700
commit13e77c2f22747b96dafef86e50c43d818fe624bb (patch)
treef94887ac2ef81ab51f5df20e4f605d639c8410da /packages/server/src/authentication/verifyAuthenticationResponse.test.ts
parentee460f1389e8bb505613bbb21ad5fb8db8128d7a (diff)
Test return of new values from verification
Diffstat (limited to 'packages/server/src/authentication/verifyAuthenticationResponse.test.ts')
-rw-r--r--packages/server/src/authentication/verifyAuthenticationResponse.test.ts13
1 files changed, 13 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
*/