#1 login dialog and function. Login works fine, but in case of a
exception, it seems to be buggy.