ClinicWave / clinicwave-frontend

2 stars 1 forks source link

Update Verification Form to Use Token Instead of Email #11

Closed aamirxshaikh closed 3 months ago

aamirxshaikh commented 3 months ago

We need to update the frontend code to accommodate the backend changes where the verification process now uses a unique token instead of an email address. This will ensure that the frontend aligns with the backend's improved security and consistency measures.

Changes Required:

  1. VerificationForm.tsx:
    • Modify the useEffect hook to retrieve the token parameter from the URL instead of email.
    • Update the checkVerificationStatus function to accept a token instead of email.
    • Update the API call to use the token as a query parameter instead of email.
    • Handle the response to include the email field and update the state accordingly.

Acceptance Criteria:

  1. The verification process on the frontend uses the token from the URL for verification.
  2. The checkVerificationStatus function correctly calls the updated backend endpoint using the token.
  3. The frontend displays the appropriate success message based on the verification status.
  4. The email associated with the verification is correctly retrieved and handled in the component's state.
  5. All affected components and logic are tested and working correctly.

Additional Notes

This update will ensure that the frontend properly interacts with the backend's new token-based verification process, maintaining the application's security and functionality.