src/utils/utils.js
//Check response status, if status 401, then clear storage and redirect to login page
Check response status, if status 401, then clear storage and redirect to login page
Check response status if status 401 then clear storage and redirect to login page
function checkStatus(response) {
    if (!response.ok) {   
        if(response.status === STATUS_403) {
            browserHistory.push('/403');
        }
        if(response.status === STATUS_401) {
            browserHistory.push('/401');
        }
        const error = new Error(response.statusText);
        error.response = response;
        throw error;
    }
    return response;
}
function checkStatus ( response ) { if ( ! response . ok ) { if ( response . status === STATUS_403 ) { browserHistory . push ( '/403' ) ; } if ( response . status === STATUS_401 ) { browserHistory . push ( '/401' ) ; } const error = new Error ( response . statusText ) ; error . response = response ; throw error ; } return response ; }
Check response status, if status 401, then clear storage and redirect to login page
Check response status if status 401 then clear storage and redirect to login page
// (response.status < 200 || response.status > 300)