adds validation to check if the user is signed in and adds the userId and author attributes to the post when is created