[FIX] Change force logout rule (#1640)
This commit is contained in:
parent
7f9a2970a3
commit
64ca30f84c
|
@ -36,11 +36,11 @@ const handleLoginRequest = function* handleLoginRequest({ credentials, logoutOnE
|
|||
result = yield call(loginWithPasswordCall, credentials);
|
||||
}
|
||||
return yield put(loginSuccess(result));
|
||||
} catch (error) {
|
||||
if (logoutOnError) {
|
||||
} catch (e) {
|
||||
if (logoutOnError && (e.data && e.data.message && /you've been logged out by the server/i.test(e.data.message))) {
|
||||
yield put(logout());
|
||||
} else {
|
||||
yield put(loginFailure(error));
|
||||
yield put(loginFailure(e));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue