From 8ddc551cc83a81ade3206e6e04c516ff15215993 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Fri, 10 Mar 2023 01:25:22 -0300
Subject: remove webui from login url, ad qr for template, fix navbar size,

---
 .../src/components/exception/login.tsx                       | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'packages/merchant-backoffice-ui/src/components/exception/login.tsx')

diff --git a/packages/merchant-backoffice-ui/src/components/exception/login.tsx b/packages/merchant-backoffice-ui/src/components/exception/login.tsx
index 552e76ed6..9a0411642 100644
--- a/packages/merchant-backoffice-ui/src/components/exception/login.tsx
+++ b/packages/merchant-backoffice-ui/src/components/exception/login.tsx
@@ -42,6 +42,14 @@ function normalizeToken(r: string | undefined): string | undefined {
   return r ? `secret-token:${encodeURIComponent(r)}` : undefined;
 }
 
+function cleanUp(s: string): string {
+  let result = s;
+  if (result.indexOf("webui/") !== -1) {
+    result = result.substring(0, result.indexOf("webui/"));
+  }
+  return result;
+}
+
 export function LoginModal({ onConfirm, withMessage }: Props): VNode {
   const { url: backendUrl, token: baseToken } = useBackendContext();
   const { admin, token: instanceToken } = useInstanceContext();
@@ -50,11 +58,11 @@ export function LoginModal({ onConfirm, withMessage }: Props): VNode {
   );
   const [token, setToken] = useState(currentToken);
 
-  const [url, setURL] = useState(backendUrl);
+  const [url, setURL] = useState(cleanUp(backendUrl));
   const { i18n } = useTranslationContext();
 
   return (
-    <div class="columns is-centered">
+    <div class="columns is-centered" style={{ margin: "auto" }}>
       <div class="column is-two-thirds ">
         <div class="modal-card" style={{ width: "100%", margin: 0 }}>
           <header
-- 
cgit v1.2.3

