Skip to content

Commit 6e8b893

Browse files
committed
docs(auth): add account linking endpoints
- Added link-email endpoint description - Added verify-link-email description - Updated endpoint numbering
1 parent 683c703 commit 6e8b893

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,33 @@ These endpoints handle user authentication flows.
9393
* **Success Response:** `200 OK` with `SuccessApiResponse<AuthSuccessResponse>` containing the anonymous `User` object and the authentication `token`.
9494
* **Example:** `POST /api/v1/auth/anonymous`
9595

96-
4. **Get Current User Details**
96+
4. **Initiate Account Linking (Anonymous User)**
97+
* **Method:** `POST`
98+
* **Path:** `/api/v1/auth/link-email`
99+
* **Authentication:** Required (Bearer Token of an *anonymous* user).
100+
* **Request Body:** JSON object `{"email": "[email protected]"}`.
101+
* **Success Response:** `202 Accepted` (Indicates request accepted, email sending initiated).
102+
* **Error Response:** `401 Unauthorized` (if not authenticated), `400 Bad Request` (if not anonymous or invalid email), `409 Conflict` (if email is already in use or linking is pending).
103+
* **Example:** `POST /api/v1/auth/link-email` with body `{"email": "[email protected]"}` and `Authorization: Bearer <anonymous_token>` header.
104+
105+
5. **Complete Account Linking (Anonymous User)**
106+
* **Method:** `POST`
107+
* **Path:** `/api/v1/auth/verify-link-email`
108+
* **Authentication:** Required (Bearer Token of the *anonymous* user who initiated the link).
109+
* **Request Body:** JSON object `{"code": "123456"}`.
110+
* **Success Response:** `200 OK` with `SuccessApiResponse<AuthSuccessResponse>` containing the updated (now permanent) `User` object and a **new** authentication `token`.
111+
* **Error Response:** `401 Unauthorized` (if not authenticated), `400 Bad Request` (if not anonymous or invalid code), `400 Bad Request` via `InvalidInputException` (if code is incorrect/expired).
112+
* **Example:** `POST /api/v1/auth/verify-link-email` with body `{"code": "654321"}` and `Authorization: Bearer <anonymous_token>` header.
113+
114+
6. **Get Current User Details**
97115
* **Method:** `GET`
98116
* **Path:** `/api/v1/auth/me`
99117
* **Authentication:** Required (Bearer Token).
100118
* **Success Response:** `200 OK` with `SuccessApiResponse<User>` containing the details of the authenticated user.
101119
* **Error Response:** `401 Unauthorized`.
102120
* **Example:** `GET /api/v1/auth/me` with `Authorization: Bearer <token>` header.
103121

104-
5. **Sign Out**
122+
7. **Sign Out**
105123
* **Method:** `POST`
106124
* **Path:** `/api/v1/auth/sign-out`
107125
* **Authentication:** Required (Bearer Token).

0 commit comments

Comments
 (0)