save user name and email automatically

This commit is contained in:
b1ek 2023-02-27 11:08:44 +10:00
parent 2125bc2eab
commit 7f5b7c49dc
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 8 additions and 4 deletions

View File

@ -27,7 +27,9 @@ async function handler(req, res, next) {
current_route: req.originalUrl,
ip: req.ip,
data,
errors
errors,
name: req.session.gb_name,
email: req.session.gb_email
}));
return;
} catch (err) {
@ -64,8 +66,10 @@ async function submit(req, res, next) {
return;
}
// actual shit
req.session.gb_name = name;
req.session.gb_email = email;
// actual shit
let records = await Sequelize.Guestbook.findAll({
where: {
ip: req.ip

View File

@ -20,12 +20,12 @@ block content
tr
td Your name:
td
input(type='text' name='name' value='' style='width:50%')
input(type='text' name='name' value='' + name style='width:50%')
span(style='font-size:9pt;color:red;user-select:none' title='required') *
tr
td Your email:
td
input(type='email' name='email' value='')
input(type='email' name='email' value='' + email)
tr
td Hide your email?
td