Refactor login logic to the login widget.

**DO NOT MERGE**

A little work needs to be done yet.
Do you mean the use of `_wait_to_login`? I commented that attribute in the `__init__` method, should I explain how it's used in here?

Or maybe you're referring to the `provider_setup` sequence before the actual login...