title: Redirect Path is not working even though I am passing all arguments into it
body: <p>I have a post order section of my website and everything is working fine except for the redirect path function. I cannot tell why this function is not working. When I log redirectPath it comes out with the correct path I want from the declaration before but will not redirect the view to the correct path. I also have the redirect path set up so that is not the problem.</p>
  <pre><code>app.post('/postOrder/:id', async function(req, res, next){
     
    var customerInfo = req.body.info;
    var packageInfo = req.body.items.items;
    var storeID = req.params['id']
    let ts = Date.now();
      let date_ob = new Date(ts);
      let date = date_ob.getDate();
      let month = date_ob.getMonth() + 1;
      let year = date_ob.getFullYear();
  
  let yourOrder = []
  
  packageInfo.forEach((package) =&gt; cusOrder(package.product, package.qty));  
  
  function cusOrder(product, qty){
    let order = {product: product, qty: qty}
    yourOrder.push(order);
  }
  console.log(yourOrder);
    const order = {
        package: yourOrder,
        storenum: storeID,
        date: year+&quot;/&quot;+month+&quot;/&quot;+date,
        first: customerInfo[0].fname,
        last: customerInfo[1].lname,
        address: customerInfo[2].address,
        city: customerInfo[3].city,
        state: customerInfo[4].state,
        zipcode: customerInfo[5].zip
      }
      new Orders(order).save().then(home =&gt; {
        res.locals.redirect = &quot;/&quot;;
        res.locals.home = home;
        next()
      })
      .catch(error =&gt; {
        console.log(`Error updating user by ID: ${error.message}`);
        next(error);
      });
    
  },
  function(req, res, next) {
    let redirectPath = res.locals.redirect;
    console.log(redirectPath);
    if (redirectPath !== undefined) res.redirect(redirectPath);
    else next();
  }
  );
  </code></pre>