diff --git a/services/web/app/coffee/Features/Project/ProjectTokenGenerator.coffee b/services/web/app/coffee/Features/Project/ProjectTokenGenerator.coffee index a0fced1e68..f334e18dd9 100644 --- a/services/web/app/coffee/Features/Project/ProjectTokenGenerator.coffee +++ b/services/web/app/coffee/Features/Project/ProjectTokenGenerator.coffee @@ -15,10 +15,9 @@ module.exports = ProjectTokenGenerator = TOKEN_NUMERICS: '123456789' _randomString: (length, alphabet) -> - result = '' - crypto.randomBytes(length).map( - (b) -> result += alphabet[b % alphabet.length] - ) + result = crypto.randomBytes(length).toJSON().data.map( + (b) -> alphabet[b % alphabet.length] + ).join('') return result # Generate a 12-char token with only characters from TOKEN_ALPHA,