diff --git a/common/models/user.json b/common/models/user.json index d70a89d3..16545ab4 100644 --- a/common/models/user.json +++ b/common/models/user.json @@ -32,7 +32,7 @@ "options": { "caseSensitiveEmail": true }, - "hidden": ["password"], + "hidden": ["password", "verificationToken"], "acls": [ { "principalType": "ROLE", diff --git a/test/user.test.js b/test/user.test.js index 8e2b1494..79f6547e 100644 --- a/test/user.test.js +++ b/test/user.test.js @@ -1320,6 +1320,12 @@ describe('User', function() { }); }); + it('should hide verification tokens from user JSON', function(done) { + var user = new User({email: 'bar@bat.com', password: 'bar', verificationToken: 'a-token' }); + var data = user.toJSON(); + assert(!('verificationToken' in data)); + done(); + }); }); describe('User.confirm(options, fn)', function() {