diff options
author | Matthew Miller <matthew@millerti.me> | 2024-01-19 22:23:13 -0800 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2024-01-19 22:23:27 -0800 |
commit | a11b16ff9836ad7211ad04d37b5c1b154decf15c (patch) | |
tree | 718850bcc23537c4e86558a785bd45f5ba24c2f0 | |
parent | df343ea81a620228383f87bc3cf03bccf5ff0bb9 (diff) |
Ensure the same for authentication options
-rw-r--r-- | packages/server/src/authentication/generateAuthenticationOptions.test.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/server/src/authentication/generateAuthenticationOptions.test.ts b/packages/server/src/authentication/generateAuthenticationOptions.test.ts index f8ed0ca..8d55580 100644 --- a/packages/server/src/authentication/generateAuthenticationOptions.test.ts +++ b/packages/server/src/authentication/generateAuthenticationOptions.test.ts @@ -132,6 +132,17 @@ Deno.test('should generate a challenge if one is not provided', async () => { assert(isoBase64URL.isBase64url(options.challenge)); }); +Deno.test('should treat string challenges as UTF-8 strings', async () => { + const options = await generateAuthenticationOptions({ + challenge: 'こんにちは', + }); + + assertEquals( + options.challenge, + '44GT44KT44Gr44Gh44Gv', + ); +}); + Deno.test('should set rpId if specified', async () => { const rpID = 'simplewebauthn.dev'; |