mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-02-01 03:59:21 +01:00
Fixing user details exposure in articles example
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -44,7 +44,7 @@ ArticleSchema.statics = {
|
||||
load: function(id, cb) {
|
||||
this.findOne({
|
||||
_id: id
|
||||
}).populate('user').exec(cb);
|
||||
}).populate('user', 'name username').exec(cb);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user