AuthLogin

Login

Login a user

Query parameters

Not all of the properties of a user are returned by default. You can use the following optional query parameters to include additional properties in the response.

PropTypeDefault
_holidaze
boolean
false
Example with all optional query parameters
{
  "data": {
    "name": "my_username",
    "email": "first.last@stud.noroff.no",
    "avatar": {
      "url": "https://img.service.com/avatar.jpg",
      "alt": "My avatar alt text"
    },
    "banner": {
      "url": "https://img.service.com/banner.jpg",
      "alt": "My banner alt text"
    },
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....",
    "venueManager": true
  },
  "meta": {}
}

Login a user

POST/auth/login

You can use this endpoint to login a registered user.

Request
{
  "email": "first.last@stud.noroff.no",
  "password": "UzI1NiIsInR5cCI"
}

A successful response will return a 200 OK status code and the user profile.

Response
{
  "data": {
    "name": "my_username",
    "email": "first.last@stud.noroff.no",
    "avatar": {
      "url": "https://img.service.com/avatar.jpg",
      "alt": "My avatar alt text"
    },
    "banner": {
      "url": "https://img.service.com/banner.jpg",
      "alt": "My banner alt text"
    },
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...."
  },
  "meta": {}
}