Skip to content

Conversation

@Maria-Manuela
Copy link

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.

Well done, code looks good 👍

Comment on lines +15 to +16
"bcrypt": "^5.1.1",
"bcryptjs": "^2.4.3",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think one of these is enough?

Comment on lines +46 to +50
const generateAccessToken = (userId) => {
return jwt.sign({ userId }, process.env.ACCESS_TOKEN_SECRET, {
expiresIn: "24h",
});
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Fun that you tried out jwt!


//Registration Endpoint
//http://localhost:9000/register
app.post("/register", 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.

According to REST naming conventions, endpoints should be named after what they return or in this case create. So this endpoint could be named /users

});

// Sign-in Endpoint
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.

And this could be called /sessions

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