fix(error-handling): ensure authHeaders are updated, even on errored responses, provided the headers exist