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

Cannot read property '1' of undefined #32

Open
razic opened this issue Apr 11, 2013 · 1 comment
Open

Cannot read property '1' of undefined #32

razic opened this issue Apr 11, 2013 · 1 comment

Comments

@razic
Copy link

razic commented Apr 11, 2013

@lefnire would like to use derby-auth but no idea what's going on.

i've:

  • set up the middleware
  • set up the store
  • required the ui components
  • followed the example

however, i'm not using mongodb... i'm using racer's memory store.

i can go to the login or register pages... but when i try to register a user, and click the register button, i get this stack trace:

TypeError: Cannot read property '1' of undefined
    at Object.module.exports.getId (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/transaction.js:24:37)
    at Object.module.exports.server._commit.res.fail (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:324:43)
    at module.exports.events.init.store.eachContext.context.guardWrite.context.guardWrite (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/accessControl/accessControl.Store.js:58:26)
    at next (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
    at guard (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/accessControl/accessControl.Store.js:215:37)
    at next (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
    at Object.run [as guardWrite] (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/middleware.js:10:12)
    at accessController (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/txns/txns.Store.js:103:17)
    at next (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
    at Object.run (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/middleware.js:10:12)
    at Model.module.exports.server._commit (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:332:29)
    at Model.module.exports.proto._sendOp (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:405:12)
    at Model.module.exports.proto.set.fn [as set] (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/mutators/mutators.Model.js:99:21)
    at /Users/razic/timely/guideadvisor/lib/guideadvisor/index.js:65:39
    at onRoute (/Users/razic/timely/guideadvisor/node_modules/derby/lib/derby.server.js:69:7)
    at app.router (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/lib/index.js:96:16)
    at callbacks (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/node_modules/express/lib/router/index.js:160:37)
    at param (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/node_modules/express/lib/router/index.js:134:11)
    at pass (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/node_modules/express/lib/router/index.js:141:5)
    at Router._dispatch (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/node_modules/express/lib/router/index.js:169:5)
    at dispatch (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/lib/index.js:43:21)
    at Object.middleware [as handle] (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/lib/index.js:58:7)
    at next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at app.use.fn (/Users/razic/timely/guideadvisor/node_modules/express/lib/application.js:121:9)
    at next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:127:23)
    at pass (/Users/razic/timely/guideadvisor/node_modules/express/lib/router/index.js:107:24)
    at Router._dispatch (/Users/razic/timely/guideadvisor/node_modules/express/lib/router/index.js:170:5)
    at Object.router (/Users/razic/timely/guideadvisor/node_modules/express/lib/router/index.js:33:10)
    at Context.next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at Context.actions.pass (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/context/http/actions.js:77:8)
    at SessionStrategy.authenticate (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/strategies/session.js:49:12)
    at pass (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/index.js:307:31)
    at Passport.deserializeUser (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/index.js:318:35)
    at /Users/razic/timely/guideadvisor/node_modules/derby-auth/index.js:86:16
    at pass (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/index.js:318:7)
    at Passport.deserializeUser (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/index.js:322:5)
    at SessionStrategy.authenticate (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/strategies/session.js:41:28)
    at attempt (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/middleware/authenticate.js:243:16)
    at Passport.authenticate (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/middleware/authenticate.js:244:7)
    at next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at Passport.initialize (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/middleware/initialize.js:69:5)
    at next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at Object.handle (/Users/razic/timely/guideadvisor/node_modules/derby-auth/index.js:71:16)
    at next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at Object.module.exports [as handle] (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/connect-flash/lib/flash.js:20:5)
    at next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at Object.expressInit [as handle] (/Users/razic/time

here is some information:

razic at razic in ~/timely/guideadvisor
node --version
v0.8.8

razic at razic in ~/timely/guideadvisor
cat package.json
{
  "name": "guideadvisor",
  "description": "",
  "version": "0.0.0",
  "main": "./server.js",
  "dependencies": {
    "derby": "git://github.com/Unroll-Me/derby#master",
    "racer": "git://github.com/SLaks/racer#master",
    "derby-auth": "git://github.com/lefnire/derby-auth.git",
    "express": "3.x",
    "gzippo": ">=0.2.0",
    "derby-ui-boot": "*"
  },
  "devDependencies": {
    "grunt": "~0.4.1",
    "chai": "~1.5.0",
    "grunt-cli": "~0.1.7",
    "grunt-contrib-jshint": "~0.1.1",
    "grunt-simple-mocha": "~0.4.0",
    "wd": "*"
  },
  "private": true
}
@lefnire
Copy link
Owner

lefnire commented Apr 11, 2013

I don't think derby-auth is going to work without racer-db-mongo. It might
not be too difficult to patch so it works, but I don't have the bandwidth
currently - hit me with a pull request if you get around to it.

On Thursday, April 11, 2013, Zachary Adam Kaplan wrote:

@lefnire https://github.com/lefnire would like to use derby-auth but no
idea what's going on.

i've:

  • set up the middleware
  • set up the store
  • required the ui components
  • followed the example

however, i'm not using mongodb... i'm using racer's memory store.

i can go to the login or register pages... but when i try to register a
user, and click the register button, i get this stack trace:

TypeError: Cannot read property '1' of undefined
at Object.module.exports.getId (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/transaction.js:24:37)
at Object.module.exports.server._commit.res.fail (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:324:43)
at module.exports.events.init.store.eachContext.context.guardWrite.context.guardWrite (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/accessControl/accessControl.Store.js:58:26)
at next (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at guard (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/accessControl/accessControl.Store.js:215:37)
at next (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at Object.run as guardWrite
at accessController (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/txns/txns.Store.js:103:17)
at next (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at Object.run (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/middleware.js:10:12)
at Model.module.exports.server._commit (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:332:29)
at Model.module.exports.proto._sendOp (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:405:12)
at Model.module.exports.proto.set.fn as set
at /Users/razic/timely/guideadvisor/lib/guideadvisor/index.js:65:39
at onRoute (/Users/razic/timely/guideadvisor/node_modules/derby/lib/derby.server.js:69:7)
at app.router (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/lib/index.js:96:16)
at callbacks (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/node_modules/express/lib/router/index.js:160:37)
at param (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/node_modules/express/lib/router/index.js:134:11)
at pass (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/node_modules/express/lib/router/index.js:141:5)
at Router._dispatch (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/node_modules/express/lib/router/index.js:169:5)
at dispatch (/Users/razic/timely/guideadvisor/node_modules/derby/node_modules/tracks/lib/index.js:43:21)
at Object.middleware as handle
at next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at app.use.fn (/Users/razic/timely/guideadvisor/node_modules/express/lib/application.js:121:9)
at next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:127:23)
at pass (/Users/razic/timely/guideadvisor/node_modules/express/lib/router/index.js:107:24)
at Router._dispatch (/Users/razic/timely/guideadvisor/node_modules/express/lib/router/index.js:170:5)
at Object.router (/Users/razic/timely/guideadvisor/node_modules/express/lib/router/index.js:33:10)
at Context.next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Context.actions.pass (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/context/http/actions.js:77:8)
at SessionStrategy.authenticate (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/strategies/session.js:49:12)
at pass (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/index.js:307:31)
at Passport.deserializeUser (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/index.js:318:35)
at /Users/razic/timely/guideadvisor/node_modules/derby-auth/index.js:86:16
at pass (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/index.js:318:7)
at Passport.deserializeUser (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/index.js:322:5)
at SessionStrategy.authenticate (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/strategies/session.js:41:28)
at attempt (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/middleware/authenticate.js:243:16)
at Passport.authenticate (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/middleware/authenticate.js:244:7)
at next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Passport.initialize (/Users/razic/timely/guideadvisor/node_modules/derby-auth/node_modules/passport/lib/passport/middleware/initialize.js:69:5)
at next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.handle (/Users/razic/timely/guideadvisor/node_modules/derby-auth/index.js:71:16)
at next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.module.exports as handle
at next (/Users/razic/timely/guideadvisor/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.expressInit [as handle] (/Users/razic/time

here is some information:

razic at razic in ~/timely/guideadvisor
node --version
v0.8.8

razic at razic in ~/timely/guideadvisor
cat package.json{
"name": "guideadvisor",
"description": "",
"version": "0.0.0",
"main": "./server.js",
"dependencies": {
"derby": "git://github.com/Unroll-Me/derby#master",
"racer": "git://github.com/SLaks/racer#master",
"derby-auth": "git://github.com/lefnire/derby-auth.git",
"express": "3.x",
"gzippo": ">=0.2.0",
"derby-ui-boot": ""
},
"devDependencies": {
"grunt": "~0.4.1",
"chai": "~1.5.0",
"grunt-cli": "~0.1.7",
"grunt-contrib-jshint": "~0.1.1",
"grunt-simple-mocha": "~0.4.0",
"wd": "
"
},
"private": true}


Reply to this email directly or view it on GitHubhttps://github.com//issues/32
.

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

No branches or pull requests

2 participants