popomore / github-labels

Add github labels automatically
177 stars 20 forks source link

Doesn't work with two factor auth #17

Open MoOx opened 8 years ago

MoOx commented 8 years ago

It seems it should work but it didn't for me (and error is not clear enough)

$ labels ... a-private/repo
>> No permission, enter your username and password:
[?] username: MoOx
[?] password: **********
[?] code: {github code received by sms}
Existing token found!
>> Authorize error
OAuth2 authentication requires a token or key & secret to be set

Any idea what am I doing wrong?

Marsup commented 8 years ago

Same error here, I've tracked it down to that line yielding an empty string, I don't know why...

Marsup commented 8 years ago

I might add that it worked on another machine yesterday, I'm trying it inside cloud9 now and it doesn't.

Marsup commented 8 years ago

So I don't know if it's the same problem for you but I had to revoke my existing token to make it work again. I also logged henrahmagix/github-oauth-prompt#11 to track the source of the problem. It's going to be a problem for people switching computers often, I don't see an alternative.

jaygeek commented 8 years ago

So.... Any tips for this error, gents? [two factor related]

SyntaxError: Unexpected token c
    at Object.parse (native)
    at ###########\AppData\Roaming\npm\node_modules\github-labels\node_modules\github-oauth-prompt\lib\github-oauth-prompt.js:115:32
    at Object.proto.sendError (###########\AppData\Roaming\npm\node_modules\github-labels\node_modules\github-oauth-prompt\node_modules\github\api\v3.0.0\index.js:32:13)
    at ###########\AppData\Roaming\npm\node_modules\github-labels\node_modules\github-oauth-prompt\node_modules\github\api\v3.0.0\authorization.js:119:29
    at ClientRequest.<anonymous> (###########\AppData\Roaming\npm\node_modules\github-labels\node_modules\github-oauth-prompt\node_modules\github\index.js:770:17)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at Socket.socketErrorListener (_http_client.js:256:9)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
popomore commented 8 years ago

@henrahmagix

ecasilla commented 8 years ago

+1 create this simple go script to do it for me but you need to generate your personal oauth token https://github.com/ecasilla/github_labelmaker

henrahmagix commented 8 years ago

@jaygeek's error seems to be the error response is no longer a JSON-parseable string, but probably just a regular string.

@Marsup If you or anyone else has time to look into and make a pull-request (with tests) for https://github.com/henrahmagix/github-oauth-prompt/issues/11 I'll be happy to review.

Apologies all for missing this and https://github.com/henrahmagix/github-oauth-prompt/issues/11

RichardLitt commented 8 years ago

I am getting @jaygeek's error too. Is there any word on how to fix that?

popomore commented 8 years ago

It seems github api has changed maybe, and the node-github version is really old.

I have forgotten why I use http to request github.

elijahmanor commented 6 years ago

I was having 2-factor auth problems as well.

A friend of mine mentioned that he had a .github-labels file in his home directory with a GitHub token. I created Personal Access Token on GitHub for public repo access and pasted that token in the .github-labels file.

Then the app worked just fine.

rocketraman commented 2 years ago

See https://github.com/popomore/github-labels/pull/37 to use a personal access token