openMind
openMind copied to clipboard
Added error handling issue #37
This PR addresses the need for better error handling during the login process, as discussed in issue #37. The changes introduced here aim to provide clear, user-friendly feedback for various authentication errors returned by Firebase during login attempts.
Changes:
- Enhanced error handling in the
onLoginFormSubmit
function within theuseLoginScreen
hook. - Error messages are now set based on the specific error codes returned by Firebase:
-
auth/invalid-email
: Informs the user that the email address format is incorrect. -
auth/wrong-password
: Alerts the user that the entered password is incorrect. -
auth/user-not-found
: Notifies the user when there is no account associated with the entered email. - All other errors: A generic message is shown to cover any other unexpected errors.
-
These messages are displayed directly on the LoginScreen
, enhancing the user experience by providing immediate, relevant feedback for correction or understanding of the issue at hand.
Motivation:
The need for clearer error messages was highlighted in issue #37 where it was noted that users were facing difficulties understanding the reasons behind authentication failures. This enhancement aims to resolve this by explicitly handling each error scenario.
Testing:
- Manual tests were performed to ensure that the appropriate messages are displayed for different error scenarios.
This update should make the login process more intuitive and less frustrating for users by clearly communicating what needs to be fixed or what issue might have occurred. Please review the changes and let me know if further modifications are required.
Thank you!
Overview 🚀
Give the brief about your changes
How Has This Been Tested? 🚨
- Manual
Screenshots 📸
Checklist ✅
-
[ ] My code follows the style guidelines of this project
-
[ ] I have performed a self-review of my own code
-
[ ] I have commented my code, particularly in hard-to-understand areas
-
[ ] I have made corresponding changes to the documentation
-
[ ] My changes generate no new warnings
-
[ ] I have added tests that prove my fix is effective or that my feature works
-
[ ] New and existing unit tests pass locally with my changes
-
[ ] Any dependent changes have been merged & published in downstream modules