Login rewrite finished and tested.