requestConnection and requestSwitchAccount promises fulfill when the user completes the requested action or the user presses cancel in the window.
But the promises do not fulfill if the user closes the window with the 'X' button (at least on Windows).