login() with deferred and popup