Add an isLoggedIn function to the user model