diff options
author | Matthew Miller <matthew@millerti.me> | 2020-06-05 17:54:47 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2020-06-05 17:54:47 -0700 |
commit | 1683e99a6e6a33bd6737240ca6bbc8a9d64b798b (patch) | |
tree | 0295a14f0b6337a5cfb5999195e56dac5d262369 /packages/server/src/helpers/decodeClientDataJSON.ts | |
parent | b4c1bae58a11f7651dd44b7cfc7ba210ef09a605 (diff) |
Replace asciiToBinary with more base64url usage
Diffstat (limited to 'packages/server/src/helpers/decodeClientDataJSON.ts')
-rw-r--r-- | packages/server/src/helpers/decodeClientDataJSON.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/server/src/helpers/decodeClientDataJSON.ts b/packages/server/src/helpers/decodeClientDataJSON.ts index c0ebb2b..93c6b10 100644 --- a/packages/server/src/helpers/decodeClientDataJSON.ts +++ b/packages/server/src/helpers/decodeClientDataJSON.ts @@ -1,10 +1,10 @@ -import asciiToBinary from './asciiToBinary'; +import base64url from 'base64url'; /** * Decode an authenticator's base64-encoded clientDataJSON to JSON */ export default function decodeClientDataJSON(data: string): ClientDataJSON { - const toString = asciiToBinary(data); + const toString = base64url.decode(data); const clientData: ClientDataJSON = JSON.parse(toString); // `challenge` will be Base64-encoded here. Decode it for easier comparisons with what is provided |