瀏覽代碼

Bug fix: Trying to login while unverified was not sending another email.

Lee Morgan 5 年之前
父節點
當前提交
2500557f3f
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      controllers/renderer.js

+ 1 - 3
controllers/renderer.js

@@ -29,7 +29,6 @@ module.exports = {
     Renders inventoryPage
     */
     displayDashboard: function(req, res){
-        let merchant2 = {};
         res.locals.merchant
             .populate("inventory.ingredient")
             .populate("recipes")
@@ -75,10 +74,9 @@ module.exports = {
                 return res.render("dashboardPage/dashboard", {merchant: res.locals.merchant, transactions: transactions});
             })
             .catch((err)=>{
-                //TODO: add banners to the necessary pages
                 if(err === "unverified"){
                     req.session.error = "PLEASE VERIFY YOUR EMAIL ADDRESS";
-                    return res.redirect(`/verify/email/${merchant2._id}`);
+                    return res.redirect(`/verify/email/${res.locals.merchant._id}`);
                 }
                 req.session.error = "ERROR: UNABLE TO RETRIEVE DATA";
                 return res.redirect("/");