I have a 2 page registration page in Express EJS:
/signup1 - username password /signup2 - firstname lastname
and they both have separate form fields with post buttons to create a registered user on my site.
app.post("/signup1", function(req, res) {
const signupDetail1 = {
username: req.body.username,
password: req.body.password
};
res.render("signup2");
app.post("/signup2", function(req, res) {
const signupDetail2 = {
firstName: req.body.firstName,
lastName: req.body.lastName
//mongoose create registered user here with username password (from first page) and firstname //last name from second page
});
What is the best or easiest way to pass the request variables from the first login page to the second login page to post?
Thank you in advance for your help!