textures1245 / csmju-comcamp-22nd-promote

ComCamp 22nd for Computer Science Maejo University promote project.
https://comcamp.csmju.com/
0 stars 1 forks source link

Raw Error Message Instead of User-Friendly Text in Swal Alert for Authentication Errors #9

Closed moking55 closed 9 months ago

moking55 commented 9 months ago

When a user enters an incorrect email address or password on the authentication page, a Swal alert displays the raw error message "Firebase: Error (auth/invalid-credential)." This message is not user-friendly and does not provide any helpful information to the user about the nature of the error.

Steps to Reproduce:

Go to the authentication page. Enter an incorrect email address or password. Click the "เข้าสู่ระบบ" button. A Swal alert will appear with the raw error message "Firebase: Error (auth/invalid-credential)."

Expected Behavior:

The Swal alert should display a user-friendly message, such as "Email address or password is incorrect. Please try again."

Actual Behavior:

The Swal alert displays the raw error message "Firebase: Error (auth/invalid-credential)."

image

Impact:

This bug affects the user experience by providing a confusing and unhelpful error message. The user is not able to understand why their login attempt failed and may become frustrated with the application.

Priority:

High

Resolution:

Modify the Swal alert to display a user-friendly message. Use the error code provided by Firebase to determine the specific reason for the authentication failure and show a relevant message. Improve error handling to ensure user-friendly messages are displayed throughout the application. Additional Notes:

This bug may be indicative of other areas in the application where raw error messages are displayed to users. It is recommended to review the application code and ensure that user-friendly messages are always displayed to provide a better user experience.

textures1245 commented 9 months ago

I sincerely appreciate you bringing this attention to the error message displayed on the authentication page when a user enters incorrect login credentials. The current raw error message, "Firebase: Error (auth/invalid-credential)," is indeed not user-friendly and provides no useful guidance to the user.

I have carefully reviewed the issue and implemented a solution to handle these raw Firebase error messages effectively. By creating and checking error rules as middleware, I have ensured that the Swal alert will not display the raw error message in common scenarios. Instead, it will display a user-friendly message.

This improvement will enhance the user experience by providing clear and concise error messages, guiding users toward resolving the issue and successfully logging in. It will also prevent confusion and frustration among users who may not understand the technical nature of the raw error message.

I tested these changes thoroughly to ensure that they resolved the issue and did not introduce any new bugs. And already committed this to the a0c918b commit version.

Thank you again for your valuable contribution to our project. Your attention to detail and proactive approach have helped us maintain a positive user experience and address potential usability concerns promptly.