diff options
author | Matthew Miller <matthew@millerti.me> | 2022-12-10 23:29:05 -0800 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2022-12-10 23:29:05 -0800 |
commit | c56b52a31f3414c2860d2b70c8409ba4c5a748ea (patch) | |
tree | 87f98197040225c028e8260bcc3095dc61c06462 | |
parent | 461b67c0c6fadfb55c1da6c9c8ab2693ba4c9a03 (diff) |
Explicitly prefer UV in auth options
-rw-r--r-- | packages/server/src/authentication/generateAuthenticationOptions.test.ts | 7 | ||||
-rw-r--r-- | packages/server/src/authentication/generateAuthenticationOptions.ts | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/packages/server/src/authentication/generateAuthenticationOptions.test.ts b/packages/server/src/authentication/generateAuthenticationOptions.test.ts index 9048cf5..667827f 100644 --- a/packages/server/src/authentication/generateAuthenticationOptions.test.ts +++ b/packages/server/src/authentication/generateAuthenticationOptions.test.ts @@ -41,6 +41,7 @@ test('should generate credential request options suitable for sending via JSON', }, ], timeout: 1, + userVerification: 'preferred', }); }); @@ -56,7 +57,7 @@ test('defaults to 60 seconds if no timeout is specified', () => { expect(options.timeout).toEqual(60000); }); -test('should not set userVerification if not specified', () => { +test('should set userVerification to "preferred" if not specified', () => { const options = generateAuthenticationOptions({ challenge: challengeBuffer, allowCredentials: [ @@ -65,7 +66,7 @@ test('should not set userVerification if not specified', () => { ], }); - expect(options.userVerification).toEqual(undefined); + expect(options.userVerification).toEqual('preferred'); }); test('should not set allowCredentials if not specified', () => { @@ -82,7 +83,7 @@ test('should generate without params', () => { extensions: undefined, rpId: undefined, timeout: 60000, - userVerification: undefined, + userVerification: 'preferred', }); expect(typeof challenge).toEqual('string'); }); diff --git a/packages/server/src/authentication/generateAuthenticationOptions.ts b/packages/server/src/authentication/generateAuthenticationOptions.ts index bd517e3..a3ef250 100644 --- a/packages/server/src/authentication/generateAuthenticationOptions.ts +++ b/packages/server/src/authentication/generateAuthenticationOptions.ts @@ -37,7 +37,7 @@ export function generateAuthenticationOptions( allowCredentials, challenge = generateChallenge(), timeout = 60000, - userVerification, + userVerification = 'preferred', extensions, rpID, } = options; |