login broke again, so I rolledback and then reimplemented the last couple of commits, and it seems to work now. Strange.