Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs are wrong about cloneOpts.remoteCallback #35

Open
calebTomlinson opened this issue Dec 1, 2015 · 0 comments
Open

docs are wrong about cloneOpts.remoteCallback #35

calebTomlinson opened this issue Dec 1, 2015 · 0 comments

Comments

@calebTomlinson
Copy link

referring to http://www.nodegit.org/guides/cloning/gh-two-factor/
The docs tell me that I should use the following options object for cloning with oauth.

cloneOptions.remoteCallbacks = {
  certificateCheck: function() { return 1; },
  credentials: function() {
    return NodeGit.Cred.userpassPlaintextNew(GITHUB_TOKEN, "x-oauth-basic");
  }
};

However that doesn't work and isn't what is in the tests.
I ended up using something like

var cloneOptions = {
    fetchOpts: {
      callbacks: {
        certificateCheck: function() { return 1; },
        credentials: function() {
          console.log(token);
          return nodegit.Cred.userpassPlaintextNew(token, 'x-oauth-basic');
        }
      }
    }
  };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant