jeresig / pulley

Easy Github Pull Request Lander
MIT License
175 stars 24 forks source link

Validation fails when creating credentials #67

Open robdodson opened 10 years ago

robdodson commented 10 years ago

Did a fresh npm install -g of pulley

In my project, when I run pulley 74 it asks for first time credentials but fails saying:

Validation Failed. Try again.

/usr/local/lib/node_modules/pulley/pulley.js:63
            var auth = encodeURIComponent( result.username ) + ":" + encodeURIComponent
                                                 ^
TypeError: Cannot read property 'username' of undefined
    at /usr/local/lib/node_modules/pulley/pulley.js:63:41
    at /usr/local/lib/node_modules/pulley/node_modules/prompt/lib/prompt.js:316:20
    at /usr/local/lib/node_modules/pulley/node_modules/prompt/node_modules/utile/node_modules/async/lib/async.js:136:21
    at assembler (/usr/local/lib/node_modules/pulley/node_modules/prompt/lib/prompt.js:282:18)
    at /usr/local/lib/node_modules/pulley/node_modules/prompt/lib/prompt.js:322:20
    at /usr/local/lib/node_modules/pulley/node_modules/prompt/lib/prompt.js:510:14
    at onError (/usr/local/lib/node_modules/pulley/node_modules/prompt/node_modules/read/lib/read.js:94:12)
    at Interface.<anonymous> (/usr/local/lib/node_modules/pulley/node_modules/prompt/node_modules/read/lib/read.js:66:5)
    at Interface.EventEmitter.emit (events.js:92:17)
    at Interface._ttyWrite (readline.js:620:16)

I know I've typed my username but it doesn't look like it's making it to the result object.

robdodson commented 10 years ago

I figured out what's going on here.

Pulley is using the same OAuth token description every time it registers on a new machine. Because I've already setup a token for my personal machine GH is sending back an error when I try to do the same on my work machine.

Same issue happens with hub(https://github.com/github/hub/issues/496)

The quick fix is to edit the description for the token in your account but hopefully pulley can just use a unique token every time it's registered.