From 8bf2fe7b069e94090042f7ba9fec56d92edc6057 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 21 Dec 2017 11:51:16 -0700 Subject: [PATCH] hid not logged in error --- client/coral-embed-stream/src/actions/auth.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/coral-embed-stream/src/actions/auth.js b/client/coral-embed-stream/src/actions/auth.js index b0fc61e0b..64e29a31a 100644 --- a/client/coral-embed-stream/src/actions/auth.js +++ b/client/coral-embed-stream/src/actions/auth.js @@ -278,6 +278,8 @@ const checkLoginSuccess = (user, isAdmin) => ({ isAdmin }); +const ErrNotLoggedIn = new Error('Not logged in'); + export const checkLogin = () => (dispatch, _, {rest, client, pym, storage}) => { dispatch(checkLoginRequest()); rest('/auth') @@ -286,7 +288,7 @@ export const checkLogin = () => (dispatch, _, {rest, client, pym, storage}) => { if (storage) { storage.removeItem('token'); } - throw new Error('Not logged in'); + throw ErrNotLoggedIn; } // Reset the websocket. @@ -301,7 +303,9 @@ export const checkLogin = () => (dispatch, _, {rest, client, pym, storage}) => { } }) .catch((error) => { - console.error(error); + if (error !== ErrNotLoggedIn) { + console.error(error); + } if (error.status && error.status === 401 && storage) { // Unauthorized.