Skip to content

Conversation

@lunek1
Copy link

@lunek1 lunek1 commented May 24, 2024

Netlify link

Backend: https://project-auth-0pi0.onrender.com/

Frontend: https://cheerful-froyo-159f59.netlify.app/

Collaborators

Solo

Copy link
Contributor

@HIPPIEKICK HIPPIEKICK left a 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! 🚀

Comment on lines +66 to +74
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" });
}
Copy link
Contributor

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) => {
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Cute frontend!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants