diff options
Diffstat (limited to 'packages/server/src/helpers/decodeClientDataJSON.ts')
-rw-r--r-- | packages/server/src/helpers/decodeClientDataJSON.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/server/src/helpers/decodeClientDataJSON.ts b/packages/server/src/helpers/decodeClientDataJSON.ts index bb878dc..fa09181 100644 --- a/packages/server/src/helpers/decodeClientDataJSON.ts +++ b/packages/server/src/helpers/decodeClientDataJSON.ts @@ -7,7 +7,7 @@ export function decodeClientDataJSON(data: string): ClientDataJSON { const toString = isoBase64URL.toString(data); const clientData: ClientDataJSON = JSON.parse(toString); - return clientData; + return _decodeClientDataJSONInternals.stubThis(clientData); } export type ClientDataJSON = { @@ -20,3 +20,8 @@ export type ClientDataJSON = { status: "present" | "supported" | "not-supported"; }; }; + +// Make it possible to stub the return value during testing +export const _decodeClientDataJSONInternals = { + stubThis: (value: ClientDataJSON) => value, +}; |