From e9f12850f2ffeef218155391d71e15ab8b1164e9 Mon Sep 17 00:00:00 2001 From: hatim boufnichel Date: Thu, 8 Oct 2020 20:07:06 +0200 Subject: [PATCH] unique fileds for encrypton, wall route --- src/routes.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/routes.js b/src/routes.js index 0e51da48..8ed44da5 100644 --- a/src/routes.js +++ b/src/routes.js @@ -306,9 +306,9 @@ module.exports = async ( } } else { encryptedToken = req.body.token - encryptedKey = req.body.encryptionKey + encryptedKey = req.body.encryptionKey || req.body.encryptedKey IV = req.body.iv - reqData = req.body.data + reqData = req.body.data || req.body.encryptedData } const decryptedKey = Encryption.decryptKey({ deviceId, @@ -2367,6 +2367,17 @@ module.exports = async ( } } + ap.get('/api/gun/initwall', async (req, res) => { + try { + await GunActions.initWall() + res.json({ ok: true }) + } catch (err) { + logger.error(err) + return res.status(500).json({ + errorMessage: err.message + }) + } + }) ap.get('/api/gun/follows/', apiGunFollowsGet) ap.get('/api/gun/follows/:publicKey', apiGunFollowsGet) ap.put(`/api/gun/follows/:publicKey`, apiGunFollowsPut)