Fix loop auth when url has query ac.