mongoose-auth icon indicating copy to clipboard operation
mongoose-auth copied to clipboard

Error with everyauth after 0.3 version update

Open nleush opened this issue 13 years ago • 8 comments

TypeError: Object #<Object> has no method 'User' at module.exports.findUserById (/node_modules/mongoose-auth/lib/modules/everymodule/everyauth.js:7:10)

Temporary fix available with package.json:

"dependencies": { "mongoose-auth": "git://github.com/nleush/mongoose-auth.git", }

nleush avatar Aug 09 '12 10:08 nleush

Same problem in my case:

Error detected: TypeError: Object #<Object> has no method 'User'
TypeError: Object #<Object> has no method 'User'
    at module.exports.findUserById (/node_modules/mongoose-auth/lib/modules/everymodule/everyauth.js:7:10)
    at Object.fetchUserFromSession [as handle] (/node_modules/mongoose-auth/node_modules/everyauth/index.js:52:13)
    at next (/node_modules/mongoose-auth/node_modules/everyauth/node_modules/connect/lib/http.js:204:15)
    at Object.registerReqGettersAndMethods [as handle] (/node_modules/mongoose-auth/node_modules/everyauth/index.js:28:9)
    at next (/node_modules/mongoose-auth/node_modules/everyauth/node_modules/connect/lib/http.js:204:15)
    at HTTPServer.Server.handle (/node_modules/mongoose-auth/node_modules/everyauth/node_modules/connect/lib/http.js:217:3)
    at Object.Server.use.handle (/node_modules/express/node_modules/connect/lib/http.js:106:14)
    at next (/node_modules/express/node_modules/connect/lib/http.js:204:15)
    at exports.send (/node_modules/express/node_modules/connect/lib/middleware/static.js:150:11)
    at Object.oncomplete (fs.js:297:15)

aadamowski avatar Aug 11 '12 23:08 aadamowski

Same here.

stefaneg avatar Aug 25 '12 12:08 stefaneg

same here @nleush i tried your package.json hack, and indeed it resolved it temporarily, but it causes an unmet dependency error when i run npm shrinkwrap.

I was able to resolve it by forcing an upgrade to mongoose 3.x all around. I also forked mongoose-auth here: https://github.com/davisford/mongoose-auth and I forced it to mongoose 3.x. In my project, I also depend on mongoose, so I forced that to 3.x and all seems to be working again. Here's the commit on my project -- you can inspect the complete npm-shrinkwrap to see if it helps resolve your deps. https://github.com/davisford/daisycentral/commit/053be0b9e66d3f9bcfc8522ca456f6a26d83602a

davisford avatar Aug 25 '12 16:08 davisford

In my case the problem's cause was in Everyauth - see Issue 322, where the new Express autodetection functionality is put to blame.

I've submitted pull request 323 to revert this functionality since it seems to be inherently broken to me.

aadamowski avatar Aug 25 '12 22:08 aadamowski

Is there any recent news on this issue?

joscha avatar Dec 05 '12 14:12 joscha

In my case, we've migrated to PassportJS since:

  1. everyauth and mongoose-auth seem to not be maintained anymore,
  2. some design decisions in everyauth seriously violate programming best practices - the code is tied too closely with particular versions of Express, see Everyauth issue 322.

aadamowski avatar Dec 05 '12 14:12 aadamowski

there seems to be some activity 20 days ago: https://github.com/bnoguchi/everyauth/tree/express3. @bnoguchi is there any news on this?

@aadamowski Is there a comparable persistence module for Passport?

joscha avatar Dec 05 '12 14:12 joscha

AFAIR we've implemented a custom module analogous to Mongoose-auth. It wasn't exactly rocket science.

aadamowski avatar Dec 05 '12 14:12 aadamowski