Refactor login logic to the login widget.

**DO NOT MERGE**

A little work needs to be done yet.
that's what inheritance is for, imho. if it's used in several places, more reasons to do it.