Added login checking to the category and post routes.