Skip to content

Integration: forgot password wiring - #54

Open
Prajeeth-12 wants to merge 3 commits into
mainfrom
33-int/forgot-wire-naseer
Open

Integration: forgot password wiring#54
Prajeeth-12 wants to merge 3 commits into
mainfrom
33-int/forgot-wire-naseer

Conversation

@Prajeeth-12

Copy link
Copy Markdown
Collaborator

This pull request adds backend integration and improves user feedback for the forgot password page. The main changes include creating a reusable API helper, connecting the forgot password form to the backend, and enhancing the UI to handle loading and error states.

API integration and error handling:

  • Added a generic apiPost helper in frontend/src/lib/api.js for making POST requests and handling errors and JSON parsing.
  • Connected the forgot password form to the backend by calling apiPost('/api/v1/auth/forgot-password', { phoneOrEmail }) on submit, and handling API errors with user-friendly messages.

UI/UX improvements:

  • Displayed error messages to users when the forgot password request fails, using a styled error box.
  • Disabled the input field and submit button during API requests, and showed a loading state on the button.
image

@Munazzah-Rakhangi Munazzah-Rakhangi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Tested locally — backend POST /api/v1/auth/forgot-password works correctly (returns 200 via curl), but the frontend call still fails with 404.

Please:

  • Verify the endpoint path (/api/v1/auth/forgot-password) matches the backend.
  • Check VITE_API_URL in .env and ensure the request URL is built properly.
  • Confirm payload { "phoneOrEmail": "..." } and method POST.
  • Display a clear success message on 200 and a user-friendly error on failure.
  • Connect the email flow so the actual password reset link is sent to the user’s inbox.
  • Re-test after fixing and then re-request review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6.21) Forgot Password → POST /auth/forgot-password (mock)

2 participants