-
Notifications
You must be signed in to change notification settings - Fork 24
Docs: Align API documentation with implementation #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,8 +11,9 @@ | |
| | POST | `/auth/password/reset/request` | Send password-reset email link | | ||
| | POST | `/auth/password/reset/confirm` | Set new password via reset token | | ||
| | POST | [`/auth/token/verify`](#4-access-token-verification-auto-login) | Verify access token and auto-login | | ||
| | POST | `/auth/token` | OAuth2 compatible token login (for Swagger UI/OpenAPI) | | ||
|
|
||
| *Refer to the [Micro-Level API Specification](./micro-plan.md#1-authentication-service) for more details on password reset endpoints.* | ||
| *Refer to the [Micro-Level API Specification](./micro-plan.md#1-authentication-service) for more details on password reset endpoints. Basic request/response for password reset are also summarized below.* | ||
|
|
||
| ## 1. Email/Password Sign-Up & Sign-In | ||
|
|
||
|
|
@@ -186,7 +187,75 @@ This endpoint helps in providing a seamless login experience if a valid session | |
|
|
||
| --- | ||
|
|
||
| ## 5. Client-Side Persistence & UX | ||
| ## 5. Password Reset Endpoints | ||
|
|
||
| These endpoints manage the password reset flow. | ||
|
|
||
| ### a. Request Password Reset | ||
|
|
||
| * **Endpoint**: `POST /auth/password/reset/request` | ||
| * **Description**: Initiates the password reset process by sending a reset link/token to the user's email. | ||
| * **Request**: | ||
| ```json | ||
| { | ||
| "email": "[email protected]" | ||
| } | ||
| ``` | ||
| * **Response (Success)**: | ||
| ```json | ||
| 200 OK | ||
| { | ||
| "success": true, | ||
| "message": "If the email exists, a reset link has been sent" | ||
| } | ||
| ``` | ||
|
|
||
| ### b. Confirm Password Reset | ||
|
|
||
| * **Endpoint**: `POST /auth/password/reset/confirm` | ||
| * **Description**: Allows a user to set a new password using a valid reset token. | ||
| * **Request**: | ||
| ```json | ||
| { | ||
| "reset_token": "valid_reset_token_string", | ||
| "new_password": "newSecurePassword123" | ||
| } | ||
| ``` | ||
| * **Response (Success)**: | ||
| ```json | ||
| 200 OK | ||
| { | ||
| "success": true, | ||
| "message": "Password has been reset successfully" | ||
| } | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 6. OAuth2 Token Endpoint (Primarily for Swagger/OpenAPI) | ||
|
|
||
| This endpoint is standard for OAuth2 password flow and primarily used by tools like Swagger UI for interactive API documentation. It allows users to authenticate within the Swagger interface to test protected endpoints. | ||
|
|
||
| * **Endpoint**: `POST /auth/token` | ||
| * **Description**: OAuth2 compatible token login. Expects `username` (as email) and `password` in form-data. | ||
| * **Request (form-data)**: | ||
| ``` | ||
| [email protected] | ||
| password=userpassword | ||
| ``` | ||
| * **Response (Success)**: | ||
| ```json | ||
| 200 OK | ||
| { | ||
| "access_token": "...jwt...", | ||
| "token_type": "bearer" | ||
| } | ||
| ``` | ||
| *(Note: This endpoint, as implemented in `auth/routes.py` for Swagger, returns only an access_token. The main `/auth/login/email` should be used by clients for full auth token pair.)* | ||
|
|
||
| --- | ||
|
|
||
| ## 7. Client-Side Persistence & UX | ||
|
|
||
| * **On App Launch** | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,7 @@ Retrieves the profile information for the currently authenticated user. | |
| "image_url": "https://example.com/profile.jpg", | ||
| "currency": "USD", | ||
| "created_at": "2024-01-15T10:00:00Z", | ||
| "updatedAt": "2024-01-16T12:30:00Z" | ||
| "updated_at": "2024-01-16T12:30:00Z" | ||
| } | ||
| ``` | ||
|
|
||
|
|
@@ -89,13 +89,13 @@ Allows the currently authenticated user to update their profile information and | |
| ```json | ||
| { | ||
| "user": { | ||
| "_id": "507f191e810c19729de860ea", | ||
| "id": "507f191e810c19729de860ea", | ||
| "name": "Johnathan Doe", | ||
| "email": "[email protected]", | ||
| "imageUrl": "https://example.com/profiles/johnathan_doe_new.jpg", | ||
| "image_url": "https://example.com/profiles/johnathan_doe_new.jpg", | ||
| "currency": "EUR", | ||
| "createdAt": "2024-01-10T10:00:00Z", | ||
| "updatedAt": "2025-06-11T10:15:00Z" | ||
| "created_at": "2024-01-10T10:00:00Z", | ||
| "updated_at": "2025-06-11T10:15:00Z" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anchor in summary table is now stale
Row 15 in the summary table still links to
#4-crud-endpoints-recapeven though the dedicated section is now §5 List Group Members. Update the link target to keep in-page navigation working.🤖 Prompt for AI Agents