-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add /api/login endpoint and authentication middleware #37
Conversation
shangzhel
commented
Aug 26, 2021
•
edited
Loading
edited
- Add /api/login endpoint, closes Implement login endpoint -- POST @ api/login #29
- Add /api/login unit tests
- Add authentication middleware, closes Implement authentication middleware #24
- Add authentication middleware unit tests
f31f1bc
to
3437d8d
Compare
…yPro into shangzhel/login
031c889
to
662ae68
Compare
As soon as this PR gets merged I will do #27 to show how to use the authenticated API router. |
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.
Update README.md's instruction of npm start, it seems like now a key of a certain length is required
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.
Authentication package seems complete. #29 can be resumed once merged.
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.
I think the problem is that, You ran login through auth as auth is used for all routes, which it fails as there's no cookies, and the it toss the error as it is designed to. But then the error also gets interpreted as an internal server error for some reason so.. yeah... I don't know if the fact that you called use auth after /login would means login doesn't trigger auth though. Cause if the ordering matters than it's weird that auth even gets called in the first place. I tried to find example for this on the documentation but i found nothing |
That's because your HTTP method is set to GET which falls through the login route. I do need to fix it though. |
8602cff
to
f620182
Compare
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.
lgtm