Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented JWT Authentication for User login and registration #69

Closed

Conversation

ritwik-69
Copy link
Contributor

fixes: #62

Description

Added the JWT authentication, user model using mongoose and
login and register endpoints.

Motivation and Context

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

How to Test

[Describe the steps to test the changes made in this pull request.]

Related Issues

[If applicable, mention any related issues or pull requests.]

Checklist

  • I have tested these changes locally.
  • I have reviewed the code and ensured it follows the project's coding guidelines.
  • I have updated the documentation, if necessary.
  • I have assigned reviewers to this pull request.

Screenshots (if applicable)

[If your changes include any visual updates, provide screenshots here.]

Copy link

vercel bot commented Jun 4, 2024

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 6, 2024 6:15am

This commit adds the JWT authentication, user model using mongoose and
login and register endpoints

Fixes:shivansh-bhatnagar18#62
@ritwik-69
Copy link
Contributor Author

@kuv2707 please review this too

@AadityanshuSingh AadityanshuSingh added the area: Backend(API) Issues related to the API layer in the backend. label Jun 6, 2024

router.post('/register', authRoute);

router.post('/login', authRoute);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you using the authRoute function for the login route? Authentication will be done after the login (and token generation) of the user.

Copy link
Contributor Author

@ritwik-69 ritwik-69 Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AadityanshuSingh sorry about that , I just kept it that way because the login controller was not yet made

//routes

import userRoute from '../routes/userRoute.js';

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if you wrote all the import statements in one place. You can then segregate those imports there by mentioning their use case (in this case routes) in the comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AadityanshuSingh true i just thought that keeping all the routes import together would make it look more organized

@kuv2707 kuv2707 force-pushed the master branch 3 times, most recently from 4dd6ce4 to 7bc3d56 Compare June 8, 2024 19:10
@kuv2707
Copy link
Collaborator

kuv2707 commented Jun 9, 2024

Closing as completed,
thanks for all the work @ritwik-69

@kuv2707 kuv2707 closed this Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Backend(API) Issues related to the API layer in the backend.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement JWT Authentication for User login and registration
3 participants