finished user authentication code in chapter 6