Authenticate a user and retrieve their information

POST /api/authentication/signin

Authenticates a user with the provided email and password. On successful authentication, it sets a JWT cookie for session management and returns the user's detailed information.

application/json

Body Required

  • email string(email) Required
  • password string(password) Required

Responses

  • 200 application/json

    User successfully authenticated

    Hide headers attribute Show headers attribute
    • Set-Cookie string
    Hide response attribute Show response attribute object
    • user object
      Hide user attributes Show user attributes object
      • id string
      • email string(email)
      • configuredProfile boolean
      • firstName string
      • lastName string
      • avatar string
      • theme number
  • 400 text/plain

    Bad request - email or password missing, or authentication failed

  • 500 text/plain

    Internal server error

POST /api/authentication/signin
curl \
 --request POST 'http://localhost:xxxx/api/authentication/signin' \
 --header "Content-Type: application/json" \
 --data '{"email":"用户@example.com","password":"密码123"}'
Request examples
{
  "email": "用户@example.com",
  "password": "密码123"
}
Response examples (200)
# Headers
Set-Cookie: jwt=abcde12345; Path=/; HttpOnly

# Payload
{
  "user": {
    "id": "60d0fe4f5311236168a109ca",
    "email": "用户@example.com",
    "configuredProfile": true,
    "firstName": "张",
    "lastName": "三",
    "avatar": "https://example.com/avatar.jpg",
    "theme": 1
  }
}
Response examples (400)
需要电子邮件和密码
Response examples (500)
服务器内部错误