Fix a problem with the multi-domain login and make it easier to understand.