When running yarn generate-auth-header, an error is returned.
To Reproduce
yarn generate-auth-header
yarn run v1.7.0
$ node scripts/generateHeader
buffer.js:202
throw new TypeError(kFromErrorMsg);
^
TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
at Function.Buffer.from (buffer.js:202:9)
at Object.<anonymous> (/Users/jasonrivera/open-source/open-api/scripts/generateHeader.js:5:25)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about thiscommand.
Expected behavior
When running this command a valid authorization header should be generated.
Describe the bug
When running yarn generate-auth-header, an error is returned.
To Reproduce
Expected behavior
When running this command a valid authorization header should be generated.
Additional context
https://github.com/freeCodeCamp/open-api/blob/9c5bb2207eecea8d69170bd9003c121eec5959e8/scripts/generateHeader.js#L4
If we change this line to
then I can generate an auth header.
Happy to submit a pull request if above approach is correct.