feat(auth): add logout functionality

- Implement LogoutHandler to handle user logout requests
- Add DeleteTokenInfo and GetUserIDFromToken functions to auth module
- Update README.md with logout endpoint documentation
This commit is contained in:
2026-03-03 23:02:52 +08:00
parent 9e6e6f8b19
commit 2aba81eb29
4 changed files with 83 additions and 3 deletions
+28 -2
View File
@@ -77,7 +77,7 @@ All API responses are returned in JSON format:
---
### 1. Register User
### Register User
**Endpoint:** `/register`
**Method:** POST
@@ -122,7 +122,7 @@ X-Timestamp: 1704067200000
---
### 2. Login
### Login
**Endpoint:** `/login`
**Method:** POST
@@ -166,6 +166,32 @@ X-Timestamp: 1704067200000
---
### Logout
**Endpoint:** `/logout`
**Method:** GET
**Auth Required:** Yes (token)
**Request Headers:**
```
X-Token: your_token
X-Timestamp: 1704067200000
```
| Header | Type | Required | Description |
|--------|------|----------|-------------|
| X-Token | string | Yes | Authentication token |
| X-Timestamp | int64 | Yes | Client timestamp in milliseconds |
**Response:**
```json
{
"success": true,
"message": "Logout successful"
}
```
---
### 3. Create frpc Instance
**Endpoint:** `/frpcAct/instanceMgr/create`