Fetch authenticated user's information

GET /api/authentication/fetchuserinfo

Retrieves detailed information for the currently authenticated user. This endpoint requires a valid JWT token in the cookie for authentication.

Responses

  • 200 application/json

    User information successfully retrieved

    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
  • 401 text/plain

    Unauthorized - No valid JWT token provided

  • 403 text/plain

    Forbidden - Invalid JWT token

  • 404 text/plain

    User not found

  • 500 text/plain

    Internal server error

GET /api/authentication/fetchuserinfo
curl \
 --request GET 'http://localhost:xxxx/api/authentication/fetchuserinfo' \
 --cookie "jwt=$API_KEY"
Response examples (200)
{
  "user": {
    "id": "60d0fe4f5311236168a109ca",
    "email": "用户@example.com",
    "configuredProfile": true,
    "firstName": "张",
    "lastName": "三",
    "avatar": "https://example.com/avatar.jpg",
    "theme": 1
  }
}
Response examples (401)
您未通过身份验证
Response examples (403)
无效的令牌
Response examples (404)
未找到用户
Response examples (500)
服务器内部错误