diff options
Diffstat (limited to 'auth/index.js')
-rw-r--r-- | auth/index.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/auth/index.js b/auth/index.js index 7039cdb..7aeaf77 100644 --- a/auth/index.js +++ b/auth/index.js @@ -37,6 +37,8 @@ app.post("/api/login", async (req, res) => { res.redirect("/auth"); }); +app.use("/api/logout", (req, res) => req.session.destroy() & res.redirect("/")); + app.put("/api/password", checkUser, async (req, res) => { const { pwd, newPwd } = req.body; if (!(pwd && newPwd)) return res.redirect("/auth"); |