Authenticate a user and retrieve their information
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.
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)
服务器内部错误