Skip to content

Commit

Permalink
add voucher codes
Browse files Browse the repository at this point in the history
  • Loading branch information
wslyvh committed Jul 10, 2024
1 parent b3b827a commit 664cd46
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/frontend/src/utils/getVoucherCodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ import * as jose from 'jose'
import { environment } from '@/config/environment'
import { readFile } from 'node:fs/promises'

const encryptedVoucherCodes = 'eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..vc4YkbIz7dKpzRjp.o9NWVDtMl4z734BqRE0UCFSBbAXNGQvu_-MbJ4LQL8VISKFlnqA7173gItkeHEnsU45nGQSYOLXnoZaWqNg4KNbJHK8eVpR1jN8-fDQ4ejdA_ipRWfCP2ginBJDwHRjpsaDbp6bigZRe4SCq3K_b8IUYSDtEK6SjaqWUEYIiu3OEMUVVNs0HLAz0K-FusQT9_ntJyBNuT7L5l0vmoTORSUt4VhlgHeqdWKxmwCRh4I3JD9jnDdvfblAyQV9KxjVyMBuYXu0Pgf4yrdduoEp8t3ab6YBCgJRstwdBmcKUPVopf5PEBhPeYQ48US2YGf2HO7Xs_oFkMkRgKJRIl2o7S-H3NcpVL_XAq-_LheHrd_rxxdiJYZFZThbAfrtMx2gLZdd649aa8sNBtohJlPhJdWZmo6iIApP1BrTlzk9bVbYFPz_Ozu8GM7vvbucbVcRcbUnawDzbZxeXC5aYpys5jmc7S_4oJW1zHshNUWqNzCp88Bi7ge3z0nt935_dw3ky6Q1O-8d7QPJnbAF46RA12dXiP7cwKmr_4ZowpxiUNRSCu-Ku-Soh2pOK4TtedQNIbiCwsP8peFeeKlTFB-irAIToOM8zrxJxCLISD6nQXhoMdRerXndPx3xyi3ahQNDfaKOz9W5Jdws78ZXeH0cxoDlvpOYRbb4KBxbMvDWK-n23nvdNN_xi12ygrwjmVmOsIN4VMwpaObq5IvwzhoZw7aNyj3IFKZV7mwaS8MYGwmnSc3Zo8xWU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QCsHX2ZQNkweoPVsmPyyJmEHdDO3pYW-RiGC18wlwp9rPkLS-dKxxckDM092-A905VficCyH209Xz-uNnXOMw_rxN25oHSWH9Z5GcGGn8H4MvaDdSNxVpWDpyzIH14.lwfAyNWYLwpK7DNpZ8tB2Q'

export async function getVoucherCodes() {
console.log('Get voucher codes for', process.env.NODE_ENV)
const encryptedVoucherCodes = await readFile(process.cwd() + `/src/voucherCodes.production`, {
encoding: 'utf-8',
})
return decryptVoucherCodes(encryptedVoucherCodes, environment.authSecret)
try {
return decryptVoucherCodes(encryptedVoucherCodes, environment.authSecret)
} catch (e) {
console.error('Error getting voucher codes', e)
return []
}
}

/**
Expand Down

0 comments on commit 664cd46

Please sign in to comment.