Updated login backend and tests.