react-query-auth
react-query-auth copied to clipboard
showing a 401 errormessage from the server
When logging in with wrong login-details I would like to show the 401 error message from the server. How would this be possible? I am also a bit confused as the docs refer to an error that can be derived from the useAuth hook:
const { user, login, logout, register, error, refetch } = useAuth();
But when I look at the codesandbox example it is not used, but a useState hook on the onSubmit catched error is used. Could you maybe explain how this should work?