Prevents people from accessing other pages if they are not logged in