[Issue #175] Fixing infinite request loop on invalid credentials