update ios auth logic (fix #1373)