Driver Logout (All Devices)

View as Markdown
# Driver Logout (All Devices) Revokes all active refresh tokens and increments the session version for the authenticated driver, terminating active sessions across all devices simultaneously. --- ### Endpoint Overview - **Method:** `POST` - **Route:** `/api/v1/driver/auth/logout-all` - **Authentication:** `Bearer Token (Driver JWT)` - **Content-Type:** `N/A` --- ### Request Headers | Header | Type | Required | Description | | --- | --- | --- | --- | | `Authorization` | `string` | **Yes** | Format: `Bearer` | --- ### Request Body Schema _None (No request body needed)_ --- ### Response Body Schema (`200 OK`) | Top-Level Key | Data Type | Description | | --- | --- | --- | | `message` | `string` | Logout confirmation (`"Logged out from all devices successfully"`) | --- ### Response Examples #### 1\. `200 OK` — Success ``` json { "message": "Logged out from all devices successfully" } ``` #### 2\. `401 Unauthorized` — Missing / Expired Token / Revoked Session ``` json { "error": "Unauthorized", "message": "Invalid or expired driver access token." } ``` #### 3\. `401 Unauthorized` — Missing Token Header ``` json { "error": "Unauthorized", "message": "Driver access token is missing. Header format must be &#x27;Bearer <token>&#x27;." } ``` #### 4\. `403 Forbidden` — Account Blocked / Deactivated ``` json { "error": "Forbidden", "message": "Driver account is blocked or deactivated." } ``` #### 5\. `500 Internal Server Error` ``` json { "error": "Failed to log out from all devices" } ``` --- ### Status Codes Reference | HTTP Status Code | Condition | | --- | --- | | **`200 OK`** | All active refresh tokens revoked and driver session version incremented. | | **`401 Unauthorized`** | Missing, invalid, expired token or session already revoked. | | **`403 Forbidden`** | Driver account is deactivated or blocked. | | **`500 Internal Server Error`** | Server or database error while updating token records. |

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.