Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added error handling as requested on issue on Github #38

Closed
wants to merge 1 commit into from
Closed

Added error handling as requested on issue on Github #38

wants to merge 1 commit into from

Conversation

MechanikGamer
Copy link

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 the useLoginScreen 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

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 the `useLoginScreen` 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!
@MechanikGamer MechanikGamer closed this by deleting the head repository Apr 16, 2024
@silenteyesoncode
Copy link
Member

hi @MechanikGamer
let me know if you need any help

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.

2 participants