shivansh-bhatnagar18 / multiplayer-uno

https://multiplayer-uno.vercel.app
21 stars 43 forks source link

Server: JWT Auth for login and register #74

Closed asmit27rai closed 4 weeks ago

asmit27rai commented 1 month ago

JWT Authentication For Login And Register Route

Fixes #62

Description

Implement authMiddleware for login and register authentication with jsonwebtoken and bcrypt that store password in hashed form in database and check accordingly during login and also set routes for login and register in userRoutes

Motivation and Context

[Explain the motivation behind these changes and provide any relevant context.]

How to Test

Steps For Testing:

  1. Setup Your Mongodb database.
  2. In Postman try with same route for register and login using the same model as set in userModel.js file.

Checklist

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
multiplayer-uno ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 8, 2024 8:54pm
kuv2707 commented 1 month ago

@asmit27rai This seems promising. Please squash the commits and implement an auth middleware.

Also, we should wrap all handlers in utils::catchError.

asmit27rai commented 4 weeks ago

@asmit27rai This seems promising. Please squash the commits and implement an auth middleware.

Also, we should wrap all handlers in utils::catchError.

Done.

kuv2707 commented 4 weeks ago

@asmit27rai There are some unrelated (frontend) changes in the PR. I think you squashed some commits already in upstream/master, since evidently, the commit is authored by Shivansh.

Try rebasing agains upstream/master and discarding the changes not made by you.

And while you are at it, please amend the commit message to occupy around 72 characters per line You can put the details as points to make it easier to read.

We should get done with this as fast as possible

asmit27rai commented 4 weeks ago

@asmit27rai There are some unrelated (frontend) changes in the PR. I think you squashed some commits already in upstream/master, since evidently, the commit is authored by Shivansh.

Try rebasing agains upstream/master and discarding the changes not made by you.

And while you are at it, please amend the commit message to occupy around 72 characters per line You can put the details as points to make it easier to read.

We should get done with this as fast as possible

Done from my side.

kuv2707 commented 4 weeks ago

@asmit27rai There are still merge conflicts.

Closing this as completed via a different PR, thanks for all the work!