jshttp / basic-auth

Generic basic auth Authorization header field parser
MIT License
702 stars 86 forks source link

TypeError: Cannot read property 'authorization' of undefined #1

Closed alangrus closed 10 years ago

alangrus commented 10 years ago

I have de/re-installed npm basic-auth a few times already. I had no problems until today. This is a new bug, basic-auth is erroring out which is keeping my app from starting in Nodejitsu, see:

error:   Error running command deploy
error:   Errors occured while starting the application
error:   Error output from application. This is usually a user error.
error:   
error:   /opt/run/snapshot/package/node_modules/basic-auth/index.js:13
error:     var auth = req.headers.authorization;
error:                           ^
error:   TypeError: Cannot read property 'authorization' of undefined
error:       at module.exports (/opt/run/snapshot/package/node_modules/basic-auth/index.js:13:25)
error:       at Object.<anonymous> (/opt/run/snapshot/package/app.js:51:33)
error:       at Module._compile (module.js:456:26)
error:       at Object.Module._extensions..js (module.js:474:10)
error:       at Module.load (module.js:356:32)
error:       at Function.Module._load (module.js:312:12)
error:       at Function.Module.runMain (module.js:497:10)
error:       at startup (node.js:119:16)
error:       at node.js:901:3
tj commented 10 years ago

it used to be a different module that wasn't generic, but he let me take over that module name, this is why npm should namespace with usernames, all the reasonable names are taken

alangrus commented 10 years ago

"Should" this or that is nice in the big picture. Meanwhile, what do we do to get my now broken App to work right now on Nodejitsu .

tj commented 10 years ago

looks like it's still available as https://npmjs.org/package/basic-auth-old

tj commented 10 years ago

ideally he would have just added me as a user and left the old versions intact, then I could go add a 2.0

alangrus commented 10 years ago

OK fine, switching from "basic-auth" to "basic-auth-old" got my App back online. I hope you can work the versioning.

Thanks TJ.