bmcweb: support next= url for forwarding login

Related to patchset here.  This patchset implements the bmc side of
redirecting the users URL after login correctly.

https://gerrit.openbmc-project.xyz/#/c/openbmc/phosphor-webui/+/15925

Change-Id: Idf42f4cecd29fb0c6088721eb5e10fb39e1168e7
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/include/token_authorization_middleware.hpp b/include/token_authorization_middleware.hpp
index c419c97..b186a5f 100644
--- a/include/token_authorization_middleware.hpp
+++ b/include/token_authorization_middleware.hpp
@@ -63,7 +63,8 @@
             if (http_helpers::requestPrefersHtml(req))
             {
                 res.result(boost::beast::http::status::temporary_redirect);
-                res.addHeader("Location", "/#/login");
+                res.addHeader("Location", "/#/login?next=" +
+                                              http_helpers::urlEncode(req.url));
             }
             else
             {