diff options
Diffstat (limited to 'models/User.js')
-rw-r--r-- | models/User.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/User.js b/models/User.js index 37ad39f..c5f9df7 100644 --- a/models/User.js +++ b/models/User.js @@ -148,10 +148,10 @@ UserSchema.methods = { generateRandomToken: function(length) { if (typeof(length) === 'undefined') length = 16; // default length of token - var chars = "_!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" + var chars = '_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; , token = new Date().getTime() + '_'; for (var i = 0; i < length; i++) { - var x = Math.floor(Math.random() * 62); + var x = Math.floor(Math.random() * chars.length); token += chars.charAt(x); } return token; |