From 64ca30f84cea5918b4dc4d2a1cbc7350a5837e27 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Thu, 30 Jan 2020 11:20:58 -0300 Subject: [PATCH] [FIX] Change force logout rule (#1640) --- app/sagas/login.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/sagas/login.js b/app/sagas/login.js index 7762ce4c8..2cfcb7498 100644 --- a/app/sagas/login.js +++ b/app/sagas/login.js @@ -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)); } } };