AUTH with node (part second)

After we created user model and migration, we need to create a route for login action. I will continue based on my project.

Next step — create a route for login action. Inside the app.js write following:

app.post(“/login”, login);

And we need to write the login function:

Let’s check our login route in Postman.

If you change your user data inside the body, let’s change password, you will see:

If the password is correct, when you send this request, you will see:

The second part of AUTH with node done.

--

--