Login untuk mendapatkan access token
AuthorizationBearer <token>
In: header
emailstring
Format
emailpasswordstring
Format
passwordResponse Body
curl -X POST "http://localhost:3000/api/mock/auth/login" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "secretpassword"
}'{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"token_type": "Bearer",
"expires_in": 3600,
"user": {
"id": "user123",
"email": "user@example.com",
"name": "John Doe"
}
}{
"error": {
"code": "INVALID_CREDENTIALS",
"message": "Email atau password yang Anda masukkan tidak valid",
"details": [
"Pastikan email dan password benar"
]
}
}{
"error": {
"code": "ACCOUNT_LOCKED",
"message": "Akun Anda telah terkunci sementara",
"details": [
"Terlalu banyak percobaan login yang gagal",
"Silakan coba lagi dalam 15 menit"
]
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Terlalu banyak permintaan dalam waktu singkat",
"details": [
"Maksimal 5 percobaan login per menit"
]
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Terjadi kesalahan pada server",
"details": [
"Silakan coba lagi beberapa saat"
]
}
}