Hide verificationToken

We should never be showing this publically.

Adds unit test for hiding verification token.

This is a back-port of pull request #1851 from gausie/patch-4
This commit is contained in:
Miroslav Bajtoš 2016-01-26 13:51:37 +01:00
parent 870e1010a8
commit a0a1083564
2 changed files with 7 additions and 1 deletions

View File

@ -32,7 +32,7 @@
"options": {
"caseSensitiveEmail": true
},
"hidden": ["password"],
"hidden": ["password", "verificationToken"],
"acls": [
{
"principalType": "ROLE",

View File

@ -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() {