added authentication to pins functions