added authentication for posts and comments