lefnire/derby-auth — pull request #47 by jasonmanners (2013-06-28 15:33:05+00:00)
Title: 0.5 connect session fix

I was getting an error that connectSession wasn't defined after I logged in.

The fix was to just check if connectSession was defined in readProtect as well like so:
`return next() unless shareRequest.docName? and shareRequest.agent.connectSession?.userId?`
Not sure if this is the right fix but I wasn't sure what else was going wrong. When I checked for connectSession everything worked fine and it was able to set connectSession. So not sure what was happening but this seemed to fix it.
Did anyone else get this issue?

Here is the stack trace
```
Error parsing forward channel TypeError: Cannot read property 'userId' of undefined
at protectRead (/Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/derby-auth/store.coffee:107:81)
at next (/Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/derby/node_modules/racer/node_modules/share/lib/server/index.js:70:5)
at ShareInstance._trigger (/Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/derby/node_modules/racer/node_modules/share/lib/server/index.js:77:3)
at UserAgent.trigger (/Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/derby/node_modules/racer/node_modules/share/lib/server/useragent.js:59:17)
at UserAgent.fetchAndSubscribe (/Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/derby/node_modules/racer/node_modules/share/lib/server/useragent.js:139:9)
at Session._handleMessage (/Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/derby/node_modules/racer/node_modules/share/lib/server/session.js:327:15)
at Session.pump (/Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/derby/node_modules/racer/node_modules/share/lib/server/session.js:168:10)
at Duplex. (/Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/derby/node_modules/racer/node_modules/share/lib/server/session.js:179:15)
at Duplex.g (events.js:175:14)
at Duplex.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at Duplex.Readable.push (_stream_readable.js:127:10)
at EventEmitter.onMessage (/Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/racer-browserchannel/lib/server.js:64:12)
at EventEmitter.emit (events.js:117:20)
at /Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/racer-browserchannel/node_modules/browserchannel/dist/server.js:426:34
at /Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/racer-browserchannel/node_modules/browserchannel/dist/server.js:198:23
at /Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/racer-browserchannel/node_modules/browserchannel/dist/server.js:410:27
at /Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/racer-browserchannel/node_modules/browserchannel/dist/server.js:198:23
at EventEmitter.session._receivedData (/Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/racer-browserchannel/node_modules/browserchannel/dist/server.js:394:14)
at processData (/Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/racer-browserchannel/node_modules/browserchannel/dist/server.js:618:21)
at /Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/racer-browserchannel/node_modules/browserchannel/dist/server.js:649:20
at IncomingMessage. (/Users/jason/Dropbox/Development/cirrus/spanish-inquisition-derby/node_modules/racer-browserchannel/node_modules/browserchannel/dist/server.js:122:12)
at IncomingMessage.EventEmitter.emit (events.js:92:17)
at _stream_readable.js:910:16
at process._tickCallback (node.js:415:13)
```

Also it looks like it now has my commit logs?!?!