Authentication (REST)

POST /api/auth/login ✅ ✔️

Login a user and verify the user’s identify

Request

POST /api/auth/login

Request Body

Example Request in Javascript using fetch

const response = await fetch("<https://api.icequeb.site/api/auth/login>", {
	method: "POST",
	headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
		"email": "[email protected]",
		"password": "123456789",
		"isTeacher": false
	})
});

Response

Successful Response Body

{
	"email": "[email protected]",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  "status": "success",
  "isTeacher": false
}