Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The library has support for accounts with two-factor auth? #9

Open
metcoder95 opened this issue Oct 29, 2018 · 4 comments
Open

The library has support for accounts with two-factor auth? #9

metcoder95 opened this issue Oct 29, 2018 · 4 comments
Assignees
Labels

Comments

@metcoder95
Copy link

Recently I become to experiment with the library for some project that I'm currently working, somehow when I use my GitHub account to do some tests I saw that an error comes and was from the two-factor auth (my GitHub account has the two-factor auth).

@doowb
Copy link
Collaborator

doowb commented Oct 29, 2018

Try using a personal access token (you can create one by following this GitHub article).

Then use token on the options instead of username/password:

const gists = new Gists({ token: 'XXXXXXXXXXXXXX' });

Since the linked article specifically shows command line usage, you might be able to use the token as your password like this:

const gists = new Gists({
  username: 'doowb',
  password: 'XXXXXXXXXXXXX' // token
});

If you get it working, please let me know so I can update the documentation.

@metcoder95
Copy link
Author

Thanks! It works perfectly!

Using the token option in the Gist constructor works correctly. Instead, using it as a password threw a Bad credentials error.

@doowb doowb self-assigned this Oct 30, 2018
@doowb doowb added the docs label Oct 30, 2018
@doowb
Copy link
Collaborator

doowb commented Oct 30, 2018

Thanks for letting me know. I'll get the docs updated soon.

@metcoder95
Copy link
Author

Hi, again!

I'm currently working with the edit method to update a single gist. Using the token method to auth throws an error: Error: Not Found. I think it's because using a token don't let you update a gist but in the GitHub API docs, doesn't say something about it.

Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants