Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Fixing user details exposure in articles example
Browse files Browse the repository at this point in the history
  • Loading branch information
amoshaviv committed Sep 29, 2013
1 parent 2cab7b7 commit 0cfbafa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exports.show = function(req, res) {
* List of Articles
*/
exports.all = function(req, res) {
Article.find().sort('-created').populate('user').exec(function(err, articles) {
Article.find().sort('-created').populate('user', 'name username').exec(function(err, articles) {
if (err) {
res.render('error', {
status: 500
Expand Down
2 changes: 1 addition & 1 deletion app/models/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ArticleSchema.statics = {
load: function(id, cb) {
this.findOne({
_id: id
}).populate('user').exec(cb);
}).populate('user', 'name username').exec(cb);
}
};

Expand Down

0 comments on commit 0cfbafa

Please sign in to comment.