Added log in function and basic log out button functionality.