Working with two-factor authentication by ddimitrioglo · Pull Request #450 · github-tools/github

Skip to content

Navigation Menu

Sign in

Appearance settings

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