We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6085e9 commit 7074dfaCopy full SHA for 7074dfa
1 file changed
examples/cloneFromGithubWith2Factor.js
@@ -11,24 +11,18 @@ var repoName = "{The name of the repo}";
11
// over https, it can't be done with actual 2 factor.
12
// https://github.com/blog/1270-easier-builds-and-deployments-using-git-over-https-and-oauth
13
14
-// The token has to be included in the URL if the repo is private.
15
-// Otherwise, github just wont respond, so a normal credential callback
16
-// wont work.
17
-var repoUrl = "https://" + token +
18
- ":x-oauth-basic@github.com/" +
19
- repoOwner + "/" +
20
- repoName + ".git";
21
-
22
// If the repo is public, you can use a callback instead
23
var repoUrl = "https://github.com/" + repoOwner + "/" + repoName + ".git";
24
25
var opts = {
26
- remoteCallbacks: {
27
- credentials: function() {
28
- return nodegit.Cred.userpassPlaintextNew (token, "x-oauth-basic");
29
- },
30
- certificateCheck: function() {
31
- return 1;
+ fetchOpts: {
+ callbacks: {
+ credentials: function() {
+ return nodegit.Cred.userpassPlaintextNew(token, "x-oauth-basic");
+ },
+ certificateCheck: function() {
+ return 1;
+ }
32
}
33
34
};
0 commit comments