[FIX] Change force logout rule (#1640)

This commit is contained in:
Diego Mello 2020-01-30 11:20:58 -03:00 committed by GitHub
parent 7f9a2970a3
commit 64ca30f84c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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));
}
}
};