[feature]: Add error Handling to the API fetch for Login.jsx #358
Labels
backend
This is a backend issue or PR
bug
Something isn't working
enhancement
New feature or request
frontend
This is a frontend issue or PR
good first issue
Good for newcomers
help wanted
Extra attention is needed
medium-complexity
This issue is medium complexity
medium-priority
tech-debt
This needs refactoring or improvement
Milestone
Is your feature request related to a problem? Please describe.
It is related to a possible fetch problem in Login.jsx
It needs a .catch() to trap network errors and exceptions
There are some other related issues:
The handleAuthentication function is called after setting the snackbar options, but it's not clear if this function is asynchronous or if it needs to be awaited. If it's an async operation, might need to await it to ensure proper execution order.
Before sending the credentials to the server, there is no client-side validation to check if the userData fields are filled out or formatted correctly. It's a good practice to validate user input before making a network request.
Really shouldnt be using http because that makes it relatively insecure, but its ok in development
The function seems to be using some global functions or state management (setSnackbarOptions, setOpenSnackbar, handleAuthentication). This really needs some state management improvement
Also the code for setting the snackbar options and opening the snackbar is a little repetitive
Describe the solution you would like
Fixing some of the outlying issues with this Login.jsx
Describe the alternatives you have tried
N/A
Additional context
No response
The text was updated successfully, but these errors were encountered: