Skip to content

docs are wrong about cloneOpts.remoteCallback #35

Open
@calebTomlinson

Description

@calebTomlinson

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');
        }
      }
    }
  };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions