mirror of
https://gitlab.com/nekoya/web.git
synced 2024-11-14 02:16:19 +01:00
Fixed verify mail
This commit is contained in:
parent
a9d1f8e9ee
commit
2309e319f5
2 changed files with 4 additions and 3 deletions
|
@ -241,7 +241,7 @@ router.post("/login", async (req, res) => {
|
|||
}
|
||||
});
|
||||
|
||||
router.get("/verify-mail", async (req, res) => {
|
||||
router.post("/verify-mail", async (req, res) => {
|
||||
if (!req.body.token) {
|
||||
res.status(400);
|
||||
res.json({
|
||||
|
@ -262,6 +262,7 @@ router.get("/verify-mail", async (req, res) => {
|
|||
if (result[0].verify == 0) {
|
||||
var data = {
|
||||
verify: 1,
|
||||
token: randtoken.generate(64),
|
||||
};
|
||||
conn.query(
|
||||
'UPDATE users SET ? WHERE email ="' + result[0].email + '"',
|
||||
|
|
|
@ -96,8 +96,8 @@ router.route("/logout")
|
|||
|
||||
router.get("/verify-mail", (req, res) => {
|
||||
controller.verify_mail(req.query.token).then((data) => {
|
||||
if (data == 200) {
|
||||
res.render("pages/register-verification-success");
|
||||
if (data[0] == 200) {
|
||||
res.render("pages/register-verification-completed");
|
||||
} else {
|
||||
res.redirect("/");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue