curl --request POST \
--url https://api.example.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>"
}
'{
"user": {
"id": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"currency": "<string>",
"role": "<string>",
"avatarUrl": {}
},
"token": "<string>",
"401 Unauthorized": {},
"400 Bad Request": {}
}Authenticate a user with email and password
curl --request POST \
--url https://api.example.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>"
}
'{
"user": {
"id": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"currency": "<string>",
"role": "<string>",
"avatarUrl": {}
},
"token": "<string>",
"401 Unauthorized": {},
"400 Bad Request": {}
}curl -X POST https://api.yourfinanceapp.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "SecurePass123!"
}'
{
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"currency": "USD",
"role": "USER",
"avatarUrl": "https://lh3.googleusercontent.com/a/example"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NTBlODQwMC1lMjliLTQxZDQtYTcxNi00NDY2NTU0NDAwMDAiLCJlbWFpbCI6ImpvaG4uZG9lQGV4YW1wbGUuY29tIiwicm9sZSI6IlVTRVIiLCJpYXQiOjE3MDk1NjE2MDB9.abc123def456"
}
{
"statusCode": 401,
"message": "Credenciales inválidas",
"error": "Unauthorized"
}
{
"statusCode": 400,
"message": [
"email must be an email",
"password must be a string"
],
"error": "Bad Request"
}
LOCAL auth provider (email/password)Authorization header as Bearer {token} for authenticated requests.