fix infinite loop when no authentication should be performed even after

401