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

Posting comment when logged out creates error #102

Closed
markbao opened this issue Feb 10, 2014 · 2 comments
Closed

Posting comment when logged out creates error #102

markbao opened this issue Feb 10, 2014 · 2 comments

Comments

@markbao
Copy link
Contributor

markbao commented Feb 10, 2014

Should prevent logged-out users from accessing comment form (or posting comments).

TypeError: Cannot read property 'id' of undefined
    at exports.postComment (/app/controllers/news.js:108:21)
    at callbacks (/app/node_modules/express/lib/router/index.js:164:37)
    at param (/app/node_modules/express/lib/router/index.js:138:11)
    at param (/app/node_modules/express/lib/router/index.js:135:11)
    at pass (/app/node_modules/express/lib/router/index.js:145:5)
    at Router._dispatch (/app/node_modules/express/lib/router/index.js:173:5)
    at Object.router (/app/node_modules/express/lib/router/index.js:33:10)
    at next (/app/node_modules/express/node_modules/connect/lib/proto.js:193:15)
    at Object.handle (/app/node_modules/less-middleware/lib/middleware.js:201:91)
    at next (/app/node_modules/express/node_modules/connect/lib/proto.js:193:15)
@markbao
Copy link
Contributor Author

markbao commented Feb 10, 2014

Related to #105.

@megamattron
Copy link
Member

Oops, I missed this somehow. I'll close mine.

crandles added a commit to crandles/pullup that referenced this issue Feb 11, 2014
Fix for larvalabs#102

Assert user.id presence. Otherwise an a TypeError is returned when a user is not logged in and attempts to post.
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