So, I have a rest api developed in Express. For authentication, I'm using cookies and to fetch user info I just do a get request to an endpoint that return me user info if its logged in or a 401 (Unauthorized) status code if its not. My concern is about, when I get a 401 status code, the chrome developer console print
Failed to load resource: the server responded with a status of 401 (Unauthorized)
It does not cause any bug in the client, just that It bothers me to see it hah.
Create an interceptor in the HTTP requests and upon received response, use the single line code console.clear();
to clear the console output.
In that way, even if you receive 401 or 403 or any response from server and a console error/warning is auto generated, then it will be auto cleared as well!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With