From 49c7d2eeda1d1d0e2f7bc43c40278e52b5db7a46 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Mon, 22 Oct 2018 12:25:20 -0600 Subject: [PATCH] fix: move priority up for token fetching --- client/coral-framework/services/bootstrap.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/coral-framework/services/bootstrap.js b/client/coral-framework/services/bootstrap.js index c7e00bbaa..300cd3e70 100644 --- a/client/coral-framework/services/bootstrap.js +++ b/client/coral-framework/services/bootstrap.js @@ -47,14 +47,6 @@ const getAuthToken = (store, storage) => { // capable of storing the token in localStorage, then we would have // persisted it to the redux state. return state.config.auth_token || state.auth.token; - } else if ( - !bowser.safari && - !bowser.ios && - storage && - storage.getItem('token') - ) { - // Use local storage auth tokens where there's a stable api. - return storage.getItem('token'); } else if (location.hash && location.hash.startsWith('#access_token=')) { // Check to see if the access token is living in the URL as a hash. const token = location.hash.substring(14); @@ -73,6 +65,14 @@ const getAuthToken = (store, storage) => { } return token; + } else if ( + !bowser.safari && + !bowser.ios && + storage && + storage.getItem('token') + ) { + // Use local storage auth tokens where there's a stable api. + return storage.getItem('token'); } return null;