14 endpoints backfilled: devices pending/approve/reject; users
password/profile/profile-delete self-service (admin variants in prose);
admin list_users + update_user_max_devices; progress history; book
matching; new password-rules doc.
Gate fix: authLabel missed JWT middleware written inline as
createJWTMiddleware(cfg) (uppercase 'JWT') — reported auth 'none' for
/api/auth self-service routes and would have for any wrapper-inlined
group. Labeled 'JWTMiddleware' + fallthrough 'jwt' case.
Claude registry: 12 entries. Drift fixed by gate: list_users on-device —
handler returns raw []database.Users (bare array, full model incl.
password_hash — real leak the API emits; pinned + documented; earlier
draft had invented {users,total,limit,offset} wrapper). max-devices
response is {message} only. books/match is GET /api/books/match
{matches, action}. progress history sessions = ReadingHistory rows
(pgtype fields). make test 9/9.
1.3 KiB
1.3 KiB
method, path, auth, area
| method | path | auth | area |
|---|---|---|---|
| PUT | /api/auth/users/:id/max-devices | jwt+admin | authentication |
Update User Max Devices
Update the maximum number of devices a user can register (admin only).
Endpoint: PUT /api/auth/users/:id/max-devices
Auth: Required (Admin only)
Content-Type: application/json
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string (UUID) | Yes | User UUID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| max_devices | integer | Yes | Maximum number of devices (1-100) |
Example Request
{
"max_devices": 15
}
Response (200 OK)
{
"message": null
}
Error Responses
| Code | Description |
|---|---|
| 400 | Invalid max_devices value (must be 1-100) |
| 401 | Invalid or expired token |
| 403 | User does not have admin privileges |
| 404 | User not found |