Ana içeriğe geç

Mevcut Oturum

Mevcut oturum bilgisini getirir.

Endpoint

GET /api/v1/sessions/current

Authentication

Bu endpoint authentication gerektirir.

Header: Authorization: Bearer \{token\}

Permission

  • sessions.view - Tüm oturumları görüntüleme
  • sessions.view.own - Sadece kendi oturumlarını görüntüleme

Request

Headers

HeaderDeğerZorunlu
AuthorizationBearer \{token\}Evet

Response

Success Response (200 OK)

{
"id": 1,
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"name": "Chrome on Windows",
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"device_name": "My Computer",
"device_os": "Windows",
"device_browser": "Chrome",
"device_platform": "desktop",
"location": {
"country": "Turkey",
"city": "Istanbul",
"latitude": 41.0082,
"longitude": 28.9784
},
"abilities": [],
"created_at": "2025-11-20T12:00:00.000000Z",
"last_used_at": "2025-11-20T15:00:00.000000Z",
"last_activity_at": "2025-11-20T15:00:00.000000Z",
"tokenable": {
"id": 1,
"uuid": "b0f8e9da-0a6d-4c73-8d9a-0ca1aa7d42f7",
"email": "user@example.com"
}
}

Error Responses

404 Not Found

{
"message": "Session not found"
}

403 Forbidden

{
"message": "Forbidden"
}

Code Examples

cURL

curl -X GET https://api.example.com/api/v1/sessions/current \
-H "Authorization: Bearer \{token\}"

Notes

  • Mevcut istekte kullanılan token'ın bilgilerini döner
  • Token metadata'sı otomatik olarak güncellenir
  • Location bilgileri JSON formatında saklanır