Fixing authentication failure after X domain change