Skip to content

Commit

Permalink
fix(classes): update secure code for pocket
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao authored Jan 8, 2023
1 parent ceb4939 commit 84362ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/classes/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 84362ff

Please sign in to comment.