Closed AlbanMinassian closed 8 years ago
Hello
I use source. When my JWT expire, i must test in each action if status !== 401 then redirect to action AuthAction.logout. it's work fine.
status !== 401
AuthAction.logout
But i would like to know how write like this :
// source PostSource = alt.createSource({ get: { local() {return null;}, shouldFetch() {return true;}, remote() {return axios.get();}, loading: PostActions.getLoading, success: PostActions.getSuccess, error.401: AuthActions.logout <==== redirect to this action each time if status = 401 error: PostActions.getError <=== another errors } });
Thanks
You'd have to handle that error logic in whatever action was called on failure - or code ran from the failure. They'll get the payload.
thanks
Hello
I use source. When my JWT expire, i must test in each action if
status !== 401
then redirect to actionAuthAction.logout
. it's work fine.But i would like to know how write like this :
Thanks