Updated to take PYWebLoginViewController into account.