-
Notifications
You must be signed in to change notification settings - Fork 42
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This commit adds the JWT authentication, user model using mongoose and login and register endpoints Fixes:shivansh-bhatnagar18#62
@kuv2707 please review this too |
|
||
router.post('/register', authRoute); | ||
|
||
router.post('/login', authRoute); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'; | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
4dd6ce4
to
7bc3d56
Compare
Closing as completed, |
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
Screenshots (if applicable)
[If your changes include any visual updates, provide screenshots here.]