diff options
Diffstat (limited to 'superadmin/index.js')
-rw-r--r-- | superadmin/index.js | 12 |
1 files changed, 12 insertions, 0 deletions
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 |