Skip to content

Commit

Permalink
Merge pull request #251 from chasevida/master
Browse files Browse the repository at this point in the history
Add two-factor auth cli documentation
  • Loading branch information
pksunkara committed Nov 29, 2016
2 parents 9e0399e + 8333844 commit 546c3a1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Expand Up @@ -113,11 +113,18 @@ __Many of the below use cases use parts of the above code__

#### Authenticate to github in cli mode (desktop application)

**Note:** Ensure that the scopes argument is an object containing the required `note` property. For two-factor authentication add the One Time Password `otp` key with its corresponding code to the configuration object.

```js
var scopes = {
'add_scopes': ['user', 'repo', 'gist'],
'note': 'admin script'
};

github.auth.config({
username: 'pksunkara',
password: 'password'
}).login(['user', 'repo', 'gist'], function (err, id, token) {
}).login(scopes, function (err, id, token) {
console.log(id, token);
});
```
Expand Down

0 comments on commit 546c3a1

Please sign in to comment.