From b01a04200deaad168342ba170a94dd15bad0ae79 Mon Sep 17 00:00:00 2001 From: LarsVomMars Date: Mon, 1 Feb 2021 15:44:01 +0100 Subject: just for the lulz --- superadmin/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'superadmin/index.js') diff --git a/superadmin/index.js b/superadmin/index.js index 2518f97..9498327 100644 --- a/superadmin/index.js +++ b/superadmin/index.js @@ -27,4 +27,16 @@ app.get("/api/pull", checkSuperAdmin, (req, res) => { }); }); +app.post("/api/reset", checkSuperAdmin, async (req, res) => { + const { uid } = req.body; + if (!uid) return res.json({ success: false }); + try { + const pwd = await db.regenerateUser(uid); + return res.json({ success: true, uid, pwd }); + } catch (e) { + console.error(e); + return res.json({ success: false, e }); + } +}); + module.exports = app; \ No newline at end of file -- cgit v1.2.3