Skip to content

[Feature] Forgot Password Feature #54#89

Open
aravindr001 wants to merge 1 commit intoVJLIVE:mainfrom
aravindr001:main
Open

[Feature] Forgot Password Feature #54#89
aravindr001 wants to merge 1 commit intoVJLIVE:mainfrom
aravindr001:main

Conversation

@aravindr001
Copy link
Contributor

🔥 Pull Request – Athletix

Thanks for contributing to Athletix! Please complete the following to help us review your changes efficiently.


🔖 Type of Change

  • 🚀 Feature – New functionality
  • 🐛 Fix – Bug fix
  • 🧹 Refactor – Code clean-up (no new features)
  • 🧪 Test – Added/updated tests
  • 📝 Docs – Documentation changes

📄 Description

  • Added complete "Forgot Password" functionality to the authentication system
  • Implemented email validation and user existence checking before sending reset emails
  • Added proper error handling for various Firebase Auth exceptions (user-not-found, invalid-email, too-many-requests)
  • Integrated success dialog with user-friendly messaging and instructions
  • Updated UI components to match app's color scheme (red/coral theme consistency)
  • Utilized existing MVVM architecture with AuthViewModel and AuthService

Key Features:

  • Email validation using existing ValidationService
  • Firestore user existence check via getUserDataByEmail method
  • Firebase Auth password reset email functionality
  • Loading states and error handling
  • Success confirmation dialog with clear instructions
  • Consistent UI styling with app theme

🎯 Related Issue

Fixes #66


🧪 How to Test This

  1. Navigate to: lib/views/screens/auth_screen.dart (Login screen)
  2. Perform:
    • Enter a valid email address in the email field
    • Tap the "Forgot Password?" link (red/coral colored text below password field)
    • Observe loading spinner and "Sending..." text
    • Check for success dialog or appropriate error messages
  3. Expected behavior:
    • For existing users: Success dialog with confirmation message
    • For non-existent emails: Error message "No account found with this email address"
    • For invalid emails: Email format validation error
    • For network issues: Appropriate error handling

Test Cases:

  • ✅ Valid email with existing user account
  • ✅ Valid email with non-existent user account
  • ✅ Invalid email format
  • ✅ Empty email field
  • ✅ Network connectivity issues

Tested on:

  • Android Emulator
  • Android Physical Device
  • iOS Simulator/Device (optional)

📸 UI Changes (if applicable)

Before After
No forgot password functionality Screenshot 2025-08-11 at 8 47 13 PM
N/A Screenshot 2025-08-11 at 8 48 49 PM
N/A Screenshot 2025-08-11 at 8 49 40 PM

UI Updates:

  • Added "Forgot Password?" TextButton below password field (login mode only)
  • Updated color from blue to Color(0xFFFF6B6B) to match app theme
  • Integrated loading states with existing AuthViewModel status management
  • Success dialog with icon, message, and OK button

🔐 Firebase / Firestore Updates

  • New Firestore collection or document
  • Changed Firebase rules
  • Updated Auth or FCM logic

Describe briefly:

  • Utilizes existing getUserDataByEmail method in AuthService to check user existence in Firestore before sending reset email
  • Integrates Firebase Auth sendPasswordResetEmail functionality
  • No new collections or security rule changes required
  • Leverages existing user document structure in users collection

✅ Checklist

  • Code compiles and runs as expected
  • UI works well on common device sizes
  • No debug prints or commented code
  • Ran flutter pub get and flutter format .
  • Code follows the project's naming & folder structure
  • No sensitive keys or secrets in code
  • Documentation/code comments updated (if needed)

🙋 Additional Notes

  • This implementation maintains consistency with the existing MVVM architecture
  • Error messages are user-friendly and provide clear guidance
  • The feature gracefully handles all edge cases including network failures
  • UI color scheme now fully consistent across authentication components
  • Successfully reapplied functionality that was lost during upstream merge
  • Debug prints were removed from final implementation
  • Feature works seamlessly with existing email validation and auth flow

Issue Complexity Note: This was initially labeled as Level 1, but the actual implementation complexity is Level 3 due to:

  • Multiple file modifications across ViewModels, Services, and UI components
  • Firebase Auth and Firestore integration
  • Complex state management and error handling
  • Architecture pattern adherence (MVVM)
  • Comprehensive user experience flow design

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.

[Feature] : Forgot password feature in login screen

1 participant