signup_login_with_user = (u, req, res, redirUrl) => {
  const old_session_id = getSessionId(req);
  return req.login(u.session_object, function (err) {
    if (!err) {
      const session_id = getSessionId(req);
      Trigger.emitEvent("Login", null, u, { old_session_id, session_id });
      if (getState().verifier) res.redirect("/auth/verification-flow");
      else if (getState().get2FApolicy(u) === "Mandatory")
        res.redirect("/auth/twofa/setup/totp");
      else res.redirect(redirUrl || "/");
    } else {
      req.flash("danger", err);
      res.redirect("/auth/signup");
    }
  });
}
@param {object} u
@param {object} req
@param {object} res
@returns {void}