Playing with this, hooking into the loaded event appears to work - however it'll need care to make sure cancelling login doesn't have side effects.