From 178ac3139dc768b8bb984b7583e2a1561c5918c6 Mon Sep 17 00:00:00 2001 From: Adam Buczynski Date: Sat, 11 Jun 2016 09:18:09 +1200 Subject: [PATCH] Don't delete user roles --- app/user/user.model.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/user/user.model.js b/app/user/user.model.js index 2c02b0d..725c002 100644 --- a/app/user/user.model.js +++ b/app/user/user.model.js @@ -218,9 +218,8 @@ UserSchema.statics.findByEmailAndPopulate = function(email) { UserSchema.options.toJSON = { transform(doc, ret) { - //Delete authentication related data + //Delete sensitive data delete ret.password; - delete ret.roles; delete ret.usedTokens; //Delete unnecessary data