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,
|
current_route: req.originalUrl,
|
||||||
ip: req.ip,
|
ip: req.ip,
|
||||||
data,
|
data,
|
||||||
errors
|
errors,
|
||||||
|
name: req.session.gb_name,
|
||||||
|
email: req.session.gb_email
|
||||||
}));
|
}));
|
||||||
return;
|
return;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -64,8 +66,10 @@ async function submit(req, res, next) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// actual shit
|
req.session.gb_name = name;
|
||||||
|
req.session.gb_email = email;
|
||||||
|
|
||||||
|
// actual shit
|
||||||
let records = await Sequelize.Guestbook.findAll({
|
let records = await Sequelize.Guestbook.findAll({
|
||||||
where: {
|
where: {
|
||||||
ip: req.ip
|
ip: req.ip
|
||||||
|
|
|
@ -20,12 +20,12 @@ block content
|
||||||
tr
|
tr
|
||||||
td Your name:
|
td Your name:
|
||||||
td
|
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') *
|
span(style='font-size:9pt;color:red;user-select:none' title='required') *
|
||||||
tr
|
tr
|
||||||
td Your email:
|
td Your email:
|
||||||
td
|
td
|
||||||
input(type='email' name='email' value='')
|
input(type='email' name='email' value='' + email)
|
||||||
tr
|
tr
|
||||||
td Hide your email?
|
td Hide your email?
|
||||||
td
|
td
|
||||||
|
|
Loading…
Reference in New Issue