redux-token-auth icon indicating copy to clipboard operation
redux-token-auth copied to clipboard

Errors are not accessible in the Redux store

Open arnaudcosson opened this issue 7 years ago • 3 comments

When authentification failed, errors are not accessible (or I didn't figure how) in the Redux Store. The action "redux-token-auth/SIGNIN_REQUEST_FAILED" has no "errors" attribute so I can't inform the user why it fails

redux-token-auth-no-error

I think it could be great to have errors from the server answer accessible in the frontend redux-token-auth-no-error-response

arnaudcosson avatar Sep 24 '18 08:09 arnaudcosson

@arnaudcosson it's an axios response so you can access the response object on the .response property of the error object:

signInUser({ email, password })
  .then(...)
  .catch(err => {
    console.log(err.response.data);
  });

matyi avatar Oct 17 '18 12:10 matyi

Thanks for your answer. I will try this quickly.

arnaudcosson avatar Oct 18 '18 01:10 arnaudcosson

Thanks!

Luiyit avatar Jun 13 '19 01:06 Luiyit