Closed ujjwal-kr closed 4 years ago
Hi, I tested the app, and if a user registers and does not verify the account, and then tries to login, the server throws an 401 unauthorized(401) error,, but the react client does not reflect it 😞... But this PR should to fix it 😸, as this adds a check in the login component which listens to 401 errors as well! Have a great day
Hey, I am reviewing all the endpoint errors to check if there are the same type of issues on other endpoints/views. And updating some HTTP code/errors along the way. I'll get back to your PR once it's done.
okay, cool !
okay, cool !
Ok so I have checked the errors on the server and changed some HTTP codes. Check this PR: #11 I have also changed some messages avoiding giving too much details in the client for errors 500 codes. We can maybe simplify it to handle Message errors in all the views without taking into account error codes at all in the client, like this :
if (error.response) { setServerError(error.response.data.message)}
That way the user has always some feedback.
Another thing, I am not sure about the else {return;}
. I have not used it for other views, what do you think about removing it for consistency ?
If its ok for you I'll merge #11 so you can do the modification for this PR.
okay well I am modifying my PR
do you need this modification in any other place?
do you need this modification in any other place?
yes there are handlers to modify with the new behaviour in ConfirmPage.jsx, LoginForgot.jsx, LoginResetPassword.jsx and Register.jsx (3 handlers to modify here) :
okay lemme check it out
⚡
⚡
That's perfect! Thanks for the contribution :partying_face: .
Yo, thanks.. hey wanna know a fact ?
I am just 16 yr old, and you look like a professional developer,, It was great to work with you and I will be grateful if you take me in collab with more awesome stuff 😸
Awesome :) Keep contributing in open source (big projects if you can) it will definitely help you improve 👍 I'll notify you if I start new stuff !
thats an issue actually.. i dont know how to approach large projects 😅
thats an issue actually.. i dont know how to approach large projects 😅
Have a look here : https://css-tricks.com/how-to-contribute-to-an-open-source-project/. For large project, you have to focus on small parts firsts, it will take time anyway
if a user registers and the app not verify the account, and then tries to login, the server throws an 401 unauthorized(401) error,, but the react client does not reflect . This fixes it by adding a check in the login component which listens to 401 errors