diff options
author | Sebastian <sebasjm@gmail.com> | 2023-03-10 01:25:22 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-03-10 01:25:22 -0300 |
commit | 8ddc551cc83a81ade3206e6e04c516ff15215993 (patch) | |
tree | 31145c0f17472b38cdce5520bd038e7c4d6d8df9 /packages/merchant-backoffice-ui/src/components/exception | |
parent | 2291d460e833bd6b63df0a7e9a9a16f801f39007 (diff) | |
download | wallet-core-8ddc551cc83a81ade3206e6e04c516ff15215993.tar.xz |
remove webui from login url, ad qr for template, fix navbar size,
Diffstat (limited to 'packages/merchant-backoffice-ui/src/components/exception')
-rw-r--r-- | packages/merchant-backoffice-ui/src/components/exception/login.tsx | 12 |
1 files changed, 10 insertions, 2 deletions
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 |