diff --git a/api/v0/index.js b/api/v0/index.js index 68e2793..141c8e0 100644 --- a/api/v0/index.js +++ b/api/v0/index.js @@ -198,7 +198,7 @@ const sanitize = (data) => { let results = [] const dataClone = JSON.parse(JSON.stringify(data)) - + for (let iUser = 0; iUser < dataClone.keyData.users.length; iUser++) { const user = dataClone.keyData.users[iUser] @@ -258,6 +258,11 @@ router.get('/profile/fetch', break; } + if (data.errors.length > 0) { + delete data.key + res.status(500).send(data) + } + // Return public key if (req.query.returnPublicKey) { data.keyData.key.data = data.key.publicKey