Sahil1786 / Petari

Food donate Web App
Other
53 stars 114 forks source link

Adding User Authentication Middleware using JWT Tokens #18

Open DebmalyaKuila opened 1 month ago

DebmalyaKuila commented 1 month ago

Description

To add user authentication in this application by integrating JWT(Json Web Token) based authentication middleware.

Proposed Solution :

1.Implement JWT token generation upon user login.

2.Configure middleware to authenticate incoming requests using JWT tokens.

3.Add token validation logic to ensure tokens are valid and not expired.

4.Secure sensitive routes and endpoints by requiring valid JWT tokens for access.

Labels : enhancement, security, middleware

Assignees : Assign me this issue under gssoc'24

Sahil1786 commented 1 month ago

you can contribute now

ekayZ7875 commented 1 month ago

Assign this issue me too.

ekayZ7875 commented 1 month ago

Thanks for assigning me this task

AkshitLakhera commented 1 month ago

Hi @ekayZ7875 ,

I noticed that this issue has been assigned to you, but there hasn't been any activity for a week. Are you still working on it? If you're busy or need any assistance, I'd be happy to help or take it over. Add on : I can also provide XSS protection and other security enhancements if needed.

Best, Akshit Lakhera

Kaushik-Shahare commented 1 month ago

I can create a auth.js middleware which will check and verify JWT token which is send with the request from the frontend in headers. If the token is verified it will go to next part else it will send a json response of "Unauthorized User" as a message.