Fixed promise bug, and added auth func to client pub