From 944b98cbaf94859dc9e3b616e891f6d69c765829 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Aug 2020 12:35:33 +0530 Subject: [PATCH] third commit --- routes/index.js | 2 -- routes/users.js | 5 +++-- views/register.ejs | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/routes/index.js b/routes/index.js index 0587bfc..bedf4ce 100644 --- a/routes/index.js +++ b/routes/index.js @@ -23,11 +23,9 @@ router.get('/', function (req, res) { // for add to cart router.get("/add-to-cart/:id", function (req, res) { - console.log(req.session.current_url); const productId = req.params.id; const cart = new Cart(req.session.cart ? req.session.cart : { items: {} }); - var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl; Product.findById(productId, function (err, product) { if (err) { diff --git a/routes/users.js b/routes/users.js index 53554f5..1b0f5d3 100644 --- a/routes/users.js +++ b/routes/users.js @@ -48,7 +48,8 @@ router.post('/register', (req, res) => { name, email, password, - password2 + password2, + title:"register page" }); } else { User.findOne({ email: email }).then(user => { @@ -59,7 +60,7 @@ router.post('/register', (req, res) => { name, email, password, - password2 + password2,title:"register page" }); } else { const newUser = new User({ diff --git a/views/register.ejs b/views/register.ejs index 15dbebe..9f8cc70 100644 --- a/views/register.ejs +++ b/views/register.ejs @@ -17,6 +17,7 @@ class="form-control" placeholder="Enter Name" value="<%= typeof name != 'undefined' ? name : '' %>" autofocus + required /> @@ -28,6 +29,7 @@ class="form-control" placeholder="Enter Email" value="<%= typeof email != 'undefined' ? email : '' %>" + required /> @@ -38,6 +40,7 @@ class="form-control" placeholder="Create Password" value="<%= typeof password != 'undefined' ? password : '' %>" + required />