I set a cookie from backend but the frontend requests are not able to include this cookie in the requests
i can see the cookie in the setHeaders for the login route .this is how i made request from frontend
Project for a course, Node, need jwt tokens assistance
I ask of you to not judge my programming because im a begginer, i have a question regarding the verification of jwt tokens in my web app.
I have a authRoutes.js file that covers registering and logging in to the server. It works ok and succesfully adds a user to the database and pulls the info when logging in. However when logging in a jwt token is generated that contains user id and the type of user (user or administrator). In my authMiddleware.js when i try to decode the token something goes wrong. I concluded this while testing with postman trying to add a restourant to the database, which only the administrator can do(thats why i do the authentication via token). I will give code for some files and if someone can help me i would be very grateful.
How to handle(Send) the jwt token and user data after the login
I made an app but im beginner and i didint know that i need to add an auth method .Im trying to use jwt but i dont understand how i must send back the user data .