Add tests on /login and correct code