Revert "Simplify login."

This reverts commit 688f3a48f4478af8b76d794b9f8f0b56153c1f29.