diff --git a/src/classes/User.js b/src/classes/User.js index 5c2a6d75..f8c4a06a 100644 --- a/src/classes/User.js +++ b/src/classes/User.js @@ -272,8 +272,9 @@ User.prototype.generatePocketCode = async function () { try { const cong = congregations.findCongregationById(this.cong_id); - const code = randomstring.generate(10).toUpperCase(); - const secureCode = encryptData(`${cong.country_code}${cong.cong_number}-${code}`); + const randomString = randomstring.generate(10).toUpperCase(); + const code = `${cong.country_code}${cong.cong_number}-${randomString}`; + const secureCode = encryptData(code); await db.collection('users').doc(this.id).update({ 'congregation.oCode': secureCode,