refactoring doLogin method to use UserDao.