react-query-auth icon indicating copy to clipboard operation
react-query-auth copied to clipboard

How to manage login errors

Open raphaelmsr opened this issue 3 years ago • 0 comments

Hi ! Thanks for your package

I am wondering, how to pass the server response message all the way to the View using useAuth ? I played with the axios interceptors but the login function would always succeed but even if I promise.reject in the loginFn, how to get the message to the useAuth props ?

Hope I was clear, it is a very generic issue to be honest. Logging in wrong credentials, 401 error from the backend with a message -> how do I display the message? Thanks !

raphaelmsr avatar Sep 22 '22 23:09 raphaelmsr