0

thanks for the amazing job you've done with AOR, this have been a great source of inspiration for me, especially in how to implement a proper redux store.

My question : If I make a bad request, (code 400), AOR log me out of the app. How can I prevent this and instead show a notification to my user ?

Flo
  • 71
  • 4

1 Answers1

1

You can follow the instructions to achieve it:

import { AUTH_ERROR } from 'admin-on-rest';

export default (type, params) => {
    if (type === AUTH_ERROR) {
        // As I noticed, this code is executed for any error, not only for auth-one.
        // So process the error as you wish (show message), don't log out.
    }
    // Then resolve the promise.
    return Promise.resolve();
};
Dmytro Titov
  • 2,802
  • 6
  • 38
  • 60