nviennot / easy-finance

Personal finance accounting tool
78 stars 10 forks source link

ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH #1

Closed austinliuu closed 4 years ago

austinliuu commented 4 years ago

Error reported when tried to run npm run dev Unable to login with "Request failed with status code 500"

RangeError [ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH]: Input buffers must have the same byte length at Object.timingSafeEqual (internal/crypto/util.js:89:11) at validateAuth (/Users/easy-finance/.next/server/static/development/pages/api/login.js:182:59) at module.exports../pages/api/login.js.__webpack_exports__.default (/Users/easy-finance/.next/server/static/development/pages/api/login.js:247:69) at Object.apiResolver (/Users/easy-finance/node_modules/next/dist/next-server/server/api-utils.js:42:15) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5) at async DevServer.handleApiRequest (/Users/easy-finance/node_modules/next/dist/next-server/server/next-server.js:446:9) at async Object.fn (/Users/easy-finance/node_modules/next/dist/next-server/server/next-server.js:367:37) at async Router.execute (/Users/easy-finance/node_modules/next/dist/next-server/server/router.js:42:32) at async DevServer.run (/Users/easy-finance/node_modules/next/dist/next-server/server/next-server.js:487:29) { code: 'ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH' }

nviennot commented 4 years ago

When running this:

source with_env.sh
echo $PASSWORD_SHA1

Do you see what looks like a sha1 hash in hex?

austinliuu commented 4 years ago

I used one of the popular SHA1 hash at https://md5hashing.net/hash/sha1

But the hash string produced by echo does not match the website.