mirror of
https://gitlab.com/nekoya/web.git
synced 2024-11-14 02:16:19 +01:00
Add logout
This commit is contained in:
parent
2e7a36b365
commit
5bf2242147
1 changed files with 13 additions and 0 deletions
|
@ -81,6 +81,19 @@ router.route("/login")
|
|||
});
|
||||
});
|
||||
|
||||
router.route("/logout")
|
||||
.get((req, res) => {
|
||||
auth.session_converter(req.cookies.session_token).then((key) => {
|
||||
if (key != null) {
|
||||
res.clearCookie("session_token");
|
||||
auth.session_remove(key, req.cookies.session_token);
|
||||
res.redirect("/");
|
||||
} else {
|
||||
res.redirect("/login");
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
router.get("/verify-mail", (req, res) => {
|
||||
controller.verify_mail(req.query.token).then((data) => {
|
||||
if (data == 200) {
|
||||
|
|
Loading…
Reference in a new issue