From 3e86bfdceb3f4193b44c57426252a392c3e029f5 Mon Sep 17 00:00:00 2001 From: Riley Davis Date: Tue, 29 Nov 2016 15:58:05 -0700 Subject: [PATCH] false positive on user signed in --- client/coral-framework/actions/auth.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/coral-framework/actions/auth.js b/client/coral-framework/actions/auth.js index 4139df842..13a9c72bc 100644 --- a/client/coral-framework/actions/auth.js +++ b/client/coral-framework/actions/auth.js @@ -123,6 +123,12 @@ const checkLoginFailure = error => ({type: actions.CHECK_LOGIN_FAILURE, error}); export const checkLogin = () => dispatch => { dispatch(checkLoginRequest()); coralApi('/auth') - .then(user => dispatch(checkLoginSuccess(user))) + .then(user => { + if (!user) { + throw new Error('not logged in'); + } + + dispatch(checkLoginSuccess(user)); + }) .catch(error => dispatch(checkLoginFailure(error))); };