ed-roh / mern-social-media

Complete React MERN Full Stack Social Media App
992 stars 859 forks source link

login in problem #56

Open sleiman23 opened 1 year ago

Anshv99 commented 1 year ago

i am facing login problem when i click on login button it gives me 500 internal sever error. when i used postman to see what went wrong it says { "error": "data and hash arguments required" } i think the password or the user.password in line 50 of auth.js in controllers is giving this error

piyushk2000 commented 1 year ago

actualy this is because you have not set JWT in .env file make sure to set that and it will work

rakistazecho7 commented 1 year ago

actualy this is because you have not set JWT in .env file make sure to set that and it will work

what do you mean bro, I have the same problem

killerTiger10 commented 9 months ago

in .env file, you need to describe variable like: JWT=jkbadkkvahd that will be used as the secret key for the token you are using in login.

piyushk2000 commented 9 months ago

actualy this is because you have not set JWT in .env file make sure to set that and it will work

what do you mean bro, I have the same problem

Create an .env file, put JWT='xyz'