mirror of
https://gitlab.com/nekoya/web.git
synced 2024-11-14 10:26:40 +01:00
Fix & remove some codes
This commit is contained in:
parent
bb58d906b7
commit
588e447e1c
1 changed files with 2 additions and 5 deletions
|
@ -39,7 +39,7 @@ router.route("/register")
|
|||
if (data == 200) {
|
||||
res.render("pages/register-verification-sent");
|
||||
} else {
|
||||
res.render("pages/register-error");
|
||||
res.redirect("/register");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -64,20 +64,17 @@ router.route("/login")
|
|||
.then((data) => {
|
||||
if (data[0] == 200) {
|
||||
res.cookie('session_token', Buffer.from(JSON.stringify({'user_id': data[1].id, 'session_token': data[1].session_token})).toString('base64'), { maxAge: 2592000000, httpOnly: true });
|
||||
res.render("pages/index");
|
||||
res.redirect("/");
|
||||
} else if (data[0] == 204) {
|
||||
res.render("pages/login", {
|
||||
companyName: "SALAH",
|
||||
error: "Please confim your account by checking your email",
|
||||
});
|
||||
} else if (data[0] == 205) {
|
||||
res.render("pages/login", {
|
||||
companyName: "SALAH",
|
||||
error: "Wrong Email or Password",
|
||||
});
|
||||
} else {
|
||||
res.render("pages/login", {
|
||||
companyName: "SALAH",
|
||||
error: "Wrong Email or Password",
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue