-
Notifications
You must be signed in to change notification settings - Fork 447
project-auth #330
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
base: master
Are you sure you want to change the base?
project-auth #330
Conversation
HIPPIEKICK
left a comment
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.
You've successfully created a working authentication app, well done! 🚀
| if (!name) { | ||
| return res.status(400).json({ error: "Name is required" }); | ||
| } | ||
| if (!email) { | ||
| return res.status(400).json({ error: "Email is required" }); | ||
| } | ||
| if (!password) { | ||
| return res.status(400).json({ error: "Password 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.
Nice error handling ⭐
|
|
||
| // Login endpoint to authenticate a user | ||
| // Find the user by email, if user is found and password is correct, generate and return an access token | ||
| app.post("/login", async (req, res) => { |
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.
This could be named /sessions to follow REST naming principles
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.
Cute frontend!
Netlify link
Backend: https://project-auth-0pi0.onrender.com/
Frontend: https://cheerful-froyo-159f59.netlify.app/
Collaborators
Solo