Adding code to enforce user logins