This feels wrong - this function isn't anything to do with login, and if we're resetting it here, then there's potential for a window to be opened/connected, e.g. the sidebar (or a conversation window, in the later world of re-trying connections), and to reset this whilst we're in a login attempt.