From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Testing the login API using Postman

Testing the login API using Postman

Let me open the postman and we'll open the new tab for login API. Now let me copy the URL from the signup API and paste it in the URL field here and we'll update the signup to login. And finally, let me set the request method to post. Now I will open the body section and select the raw option. And then I will add the JSON object, e-mail, I'll say test at customer.com. And password, of course, test at 1234. Now I will click on Send button. And you can see that the user is logged in. And the response with a token is displayed in the response section. Now I will try to log in with a different e-mail which does not exist in the buyer master table. So I will change the e-mail inside the body with abc at xyz dot com. And I will send the request again. And we get the error message saying user not found. And if we try to log in with an existing e-mail with invalid password, then as you can see As you can see, we get the error message Invalid Credentials. Alright, we have successfully…

Contents