diff --git a/src/routes/emailAsUser.ts b/src/routes/emailAsUser.ts index 0017688..c2d147a 100644 --- a/src/routes/emailAsUser.ts +++ b/src/routes/emailAsUser.ts @@ -140,10 +140,12 @@ export default async function emailAsUserRoutes(server: FastifyInstance) { const accounts = rows.map(row => { const temp: any = {} + console.log(row) Object.entries(row).forEach(([key, val]) => { - if (key.endsWith("Encrypted")) { + console.log(key,val) + if (key.endsWith("Encrypted") && val) { // @ts-ignore - temp[key.replace("Encrypted", "")] = decrypt(val as string) + temp[key.replace("Encrypted", "")] = decrypt(val) } else { temp[key] = val } @@ -189,7 +191,7 @@ export default async function emailAsUserRoutes(server: FastifyInstance) { const accountData: any = {} Object.entries(row).forEach(([key, val]) => { - if (key.endsWith("Encrypted")) { + if (key.endsWith("Encrypted") && val) { // @ts-ignore accountData[key.replace("Encrypted", "")] = decrypt(val as string) } else {