Fix authentication process for replica sets