update d3 and add error handling
Only redirect to login page if the error is a 401 (unauthorized)

this way other errors like network being down don't cause these redirects