Show login form if login fails. Fix #10.

* Also added integration test.