Add functionality for checking if a user is logged in