aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/components/exception/login.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/components/exception/login.tsx')
-rw-r--r--packages/merchant-backoffice-ui/src/components/exception/login.tsx12
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