.catch(response => { dispatch(receiveError()); dispatch(pushState(null,'/error')); })
.catch(function(response){ dispatch(receiveError(response.data)); dispatch(pushState(null,'/error')); })
.then(response => { dispatch(setUser(response.data)); dispatch(pushState(null,'/dashboard')); })