Keithpohl82 / Fridget

0 stars 3 forks source link

Daily Update 11/13/2024 Andy B #34

Open abarkera4 opened 3 days ago

abarkera4 commented 3 days ago

Fridget App - Feature Implementation Summary for Andy B

Date: 11/13/2024

Completed Features & Enhancements

  1. Password Reset Functionality

    • Backend:
      • Added endpoints in UserController to handle password reset requests.
      • Implemented requestPasswordReset to generate and email a reset token if a user exists with the provided email.
      • Added resetPassword to verify the token and allow the user to reset their password if the token is valid.
    • Frontend:
      • Updated Login and PasswordReset components to include options for users to request a password reset and enter a new password with a valid token.
      • Added messaging to notify users if the reset request fails or succeeds.
  2. Real-Time Username Availability Check

    • Backend:
      • Created a /check-username endpoint in UserController to check if a username is already taken.
      • Implemented userExistsByUsername in UserService and UserRepository to perform the username availability check.
    • Frontend:
      • Updated the Register component to check username availability in real-time as users type.
      • Added debounced calls to reduce API requests, checking availability only after the user stops typing.
      • Displayed availability messages below the username field in the registration form.
  3. Enhanced Registration Validation

    • Backend:
      • Modified the registerUser method in UserController to validate unique constraints for both email and username before allowing registration.
      • Added error responses if the username or email already exists in the database.
    • Frontend:
      • Updated the Register component to handle backend validation errors.
      • Displayed error messages when attempting to register with an existing email or username.
  4. Login with Either Username or Email

    • Backend:
      • Enhanced the login functionality in UserService and UserController to accept either a username or email in a single form field.
      • Implemented logic to detect if the identifier is an email or username and retrieve the user accordingly.
    • Frontend:
      • Updated the Login component to use a single "Username or Email" field, allowing users to enter either.
      • Adjusted the handleSubmit function to send the identifier (username or email) to the backend for authentication.
      • Updated placeholder text to make it clear to users that they can log in with either username or email.
  5. Error Handling and User Feedback

    • Added user feedback mechanisms on both frontend and backend:
      • Error messages: Informs users about issues like unavailable usernames, invalid login credentials, and existing email registrations.
      • Success messages: Confirms actions like successful registration and password reset, improving user experience.

Summary

With these enhancements, the Fridget app now includes:

These updates make Fridget more user-friendly, flexible, and secure.