--- a/client/src/sagas/networkSaga.js Mon Jun 26 15:21:06 2017 +0200
+++ b/client/src/sagas/networkSaga.js Mon Jun 26 16:05:47 2017 +0200
@@ -11,7 +11,6 @@
}
function pingServer(client, token) {
- console.log("PING SERVER", token);
if(token) {
const timeout = new Promise((resolve, reject) => {
setTimeout(reject, config.networkStatusTimeout, 'request timed out');
@@ -39,6 +38,16 @@
// if the error is that there is no token, then we know we have to wait for a login
if(error.error && error.error === 'No token in the store') {
yield take(types.AUTH_LOGIN_SUCCESS);
+ } else if (error.non_field_errors &&
+ error.non_field_errors &&
+ error.non_field_errors.length &&
+ error.non_field_errors.length > 0 &&
+ ( error.non_field_errors[0] === 'Signature has expired.' ||
+ error.non_field_errors[0] === 'Refresh has expired.' )
+ ) {
+ yield put({
+ type: types.AUTH_DEAUTHENTICATE
+ });
}
} finally {
if (yield cancelled()) {