save user name and email automatically
This commit is contained in:
parent
2125bc2eab
commit
7f5b7c49dc
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue