Skip to content

Commit

Permalink
chore(js): add TODO comments about generateCodeChallenge and crypto (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
IceHe authored Feb 11, 2022
1 parent c4a4c1b commit a5ea947
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/js/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// https://github.com/jsdom/jsdom/issues/1612
/* eslint-disable @silverhand/fp/no-mutation */
/* eslint-disable unicorn/prefer-module */
// TODO: crypto related to linear issue LOG-1517
const { Crypto } = require('@peculiar/webcrypto');
const fetch = require('node-fetch');
const { TextDecoder, TextEncoder } = require('text-encoder');
Expand Down
1 change: 1 addition & 0 deletions packages/js/src/utils/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const generateCodeVerifier = () => generateRandomString();
*/
export const generateCodeChallenge = async (codeVerifier: string): Promise<string> => {
const encodedCodeVerifier = new TextEncoder().encode(codeVerifier);
// TODO: crypto related to linear issue LOG-1517
const codeChallenge = new Uint8Array(await crypto.subtle.digest('SHA-256', encodedCodeVerifier));

return fromUint8Array(codeChallenge, true);
Expand Down

0 comments on commit a5ea947

Please sign in to comment.