Fix E-Mail

This commit is contained in:
2025-12-17 09:23:25 +01:00
parent e6bc123481
commit 9d6f2de4ab

View File

@@ -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 {