AndrejGajdos / auth-flow-spa-node-react

🔐 User authentication in SPA, built with Node.js and React (Koa, Passport, Redux, Redux-Saga and React Router). Local authentication – users can log in using username, passport and authentication through Facebook.
http://andrejgajdos.com/authenticating-users-in-single-page-applications-using-node-passport-react-and-redux/
MIT License
30 stars 8 forks source link

Login throws TypeError Key must be a buffer - Hmac #2

Closed anagio closed 5 years ago

anagio commented 5 years ago

When I login I get this error in the output from npm run api i'm trying to update some packages but still seeing it

TypeError: Key must be a buffer
at new Hmac (crypto.js:117:16)
at Object.createHmac (crypto.js:643:10)
at sign (/Users/......./auth-flow-spa-node-react-master/node_modules/keygrip/index.js:22:8)
at Keygrip.sign (/Users/......./auth-flow-spa-node-react-master/node_modules/keygrip/index.js:29:38)
at Cookies.set (/Users/......./auth-flow-spa-node-react-master/node_modules/cookies/index.js:109:30)
at ContextSession.save (/Users/......./auth-flow-spa-node-react-master/node_modules/koa-session/lib/context.js:322:26)
at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

This happens when using the test password

anagio commented 5 years ago

Had to set KOA_SESSION_SECRET