academind/node-restful-api-tutorial

Error authenticating user login

PriyaJainDev opened this issue · 0 comments

I followed your steps for creating a new user. It returned a proper email and id. But now when I try to POST request for /login using postman, it does not work. It shows the following error:

`POST /user/signup 201 819.342 ms - 26
C:\Users\Admin\Desktop\one-way-travel\node_modules\jsonwebtoken\sign.js:97
throw err;
^

Error: secretOrPrivateKey must have a value
at Object.module.exports [as sign] (C:\Users\Admin\Desktop\one-way-travel\node_modules\jsonwebtoken\sign.js:101:20)
at bcrypt.compare (C:\Users\Admin\Desktop\one-way-travel\api\controllers\user.js:63:29)
`

Kindly help to resolve it soon.