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

[feature]: Add error Handling to the API fetch for Login.jsx #358

Open
gbowne1 opened this issue Feb 21, 2024 · 2 comments
Open

[feature]: Add error Handling to the API fetch for Login.jsx #358

gbowne1 opened this issue Feb 21, 2024 · 2 comments
Assignees
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

Comments

@gbowne1
Copy link
Owner

gbowne1 commented Feb 21, 2024

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

@gbowne1 gbowne1 added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers frontend This is a frontend issue or PR backend This is a backend issue or PR medium-priority medium-complexity This issue is medium complexity tech-debt This needs refactoring or improvement labels Feb 21, 2024
@gbowne1 gbowne1 added this to the User Authentication milestone Feb 21, 2024
@gbowne1 gbowne1 changed the title [feature]: Add error Handling to the API fetch for login [feature]: Add error Handling to the API fetch for Login.jsx Feb 21, 2024
@Amrani-Farouk-Hossam-Eddine
Copy link
Contributor

i'm interesting in working on this issue if no one is working on it currently

@gbowne1
Copy link
Owner Author

gbowne1 commented Feb 21, 2024

Ok @Amrani-Farouk-Hossam-Eddine

Nobody is working on it

@gbowne1 gbowne1 moved this to In Progress in ReactSocialNetwork Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Status: In Progress
Development

No branches or pull requests

2 participants