Working with two-factor authentication by ddimitrioglo · Pull Request #450 · github-tools/github
Navigation Menu
- Notifications You must be signed in to change notification settings
- Fork 801
Conversation
As mentioned in github API:
```
In addition to the Basic Authentication credentials, you must send the user's authentication code (i.e., one-time password) in the X-GitHub-OTP header.
```
And we will be able to use it like this:
```
const github = new GitHub({
username: 'ddimitrioglo',
password: 'xxxxxxxxxxxx',
otp: '888999' // <= One-Time-Password
});
let me = github.getUser();
me.listRepos((err, repos) => {
console.log(repos);
});
```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters