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/authentication/verifyAuthenticationResponse.ts2
2 files changed, 15 insertions, 0 deletions
diff --git a/packages/server/src/authentication/verifyAuthenticationResponse.test.ts b/packages/server/src/authentication/verifyAuthenticationResponse.test.ts
index 3c9a5b3..3b8e7b6 100644
--- a/packages/server/src/authentication/verifyAuthenticationResponse.test.ts
+++ b/packages/server/src/authentication/verifyAuthenticationResponse.test.ts
@@ -432,3 +432,16 @@ const authenticatorFirstTimeUsed: AuthenticatorDevice = {
),
counter: 0,
};
+
+test('should return user verified flag after successful auth', async () => {
+ const verification = await verifyAuthenticationResponse({
+ credential: assertionResponse,
+ expectedChallenge: assertionChallenge,
+ expectedOrigin: assertionOrigin,
+ expectedRPID: 'dev.dontneeda.pw',
+ authenticator: authenticator,
+ });
+
+ expect(verification.authenticationInfo?.userVerified).toBeDefined();
+ expect(verification.authenticationInfo?.userVerified).toEqual(false);
+});
diff --git a/packages/server/src/authentication/verifyAuthenticationResponse.ts b/packages/server/src/authentication/verifyAuthenticationResponse.ts
index d25d521..ff005fe 100644
--- a/packages/server/src/authentication/verifyAuthenticationResponse.ts
+++ b/packages/server/src/authentication/verifyAuthenticationResponse.ts
@@ -219,6 +219,7 @@ export async function verifyAuthenticationResponse(
authenticationInfo: {
newCounter: counter,
credentialID: authenticator.credentialID,
+ userVerified: flags.uv,
credentialDeviceType,
credentialBackedUp,
authenticatorExtensionResults: extensionsData,
@@ -251,6 +252,7 @@ export type VerifiedAuthenticationResponse = {
authenticationInfo: {
credentialID: Buffer;
newCounter: number;
+ userVerified: boolean;
credentialDeviceType: CredentialDeviceType;
credentialBackedUp: boolean;
authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs;