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

showing a 401 errormessage from the server

Open zouterover opened this issue 4 years ago • 0 comments

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?

zouterover avatar Nov 03 '21 19:11 zouterover