summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src/authentication/verifyAuthenticationResponse.test.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2023-07-27 08:42:05 -0700
committerGitHub <noreply@github.com>2023-07-27 08:42:05 -0700
commitf30a195ab1c5b7476fb8056e6ac25a13a7546452 (patch)
treec2779d080e51bea1463effd581752cd245b9940a /packages/server/src/authentication/verifyAuthenticationResponse.test.ts
parent5731c7d0427323bbd78df195295c28eb39f822ba (diff)
parent22ca0cd6dab119a28794dbaa33d650f97ab107a1 (diff)
Merge pull request #415 from Mikescops/feature/add-origin-authentication-registration-info
Add origin and rpID in authentication and registration info
Diffstat (limited to 'packages/server/src/authentication/verifyAuthenticationResponse.test.ts')
-rw-r--r--packages/server/src/authentication/verifyAuthenticationResponse.test.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/server/src/authentication/verifyAuthenticationResponse.test.ts b/packages/server/src/authentication/verifyAuthenticationResponse.test.ts
index 30eb9d1..5a760e4 100644
--- a/packages/server/src/authentication/verifyAuthenticationResponse.test.ts
+++ b/packages/server/src/authentication/verifyAuthenticationResponse.test.ts
@@ -44,6 +44,8 @@ test('should return authenticator info after verification', async () => {
expect(verification.authenticationInfo.newCounter).toEqual(144);
expect(verification.authenticationInfo.credentialID).toEqual(authenticator.credentialID);
+ expect(verification.authenticationInfo?.origin).toEqual(assertionOrigin);
+ expect(verification.authenticationInfo?.rpID).toEqual('dev.dontneeda.pw');
});
test('should throw when response challenge is not expected value', async () => {
@@ -224,6 +226,7 @@ test('should support multiple possible origins', async () => {
});
expect(verification.verified).toEqual(true);
+ expect(verification.authenticationInfo?.origin).toEqual(assertionOrigin);
});
test('should throw an error if origin not in list of expected origins', async () => {
@@ -249,6 +252,7 @@ test('should support multiple possible RP IDs', async () => {
});
expect(verification.verified).toEqual(true);
+ expect(verification.authenticationInfo?.rpID).toEqual('dev.dontneeda.pw');
});
test('should throw an error if RP ID not in list of possible RP IDs', async () => {