diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index c6a43875..55922380 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -55,6 +55,8 @@ "text": "Did you configure it correctly?", "title": "Failed to reach server" }, + "noHostTitle": "Server not configured!", + "noHost": "The server has not been configured, therefore you cannot create an account", "host": "You are connecting to <0>{{hostname}} - please confirm you trust it before making an account", "no": "Go back", "title": "Do you trust this server?", diff --git a/src/pages/parts/auth/TrustBackendPart.tsx b/src/pages/parts/auth/TrustBackendPart.tsx index 0d71e403..16c16c66 100644 --- a/src/pages/parts/auth/TrustBackendPart.tsx +++ b/src/pages/parts/auth/TrustBackendPart.tsx @@ -23,7 +23,7 @@ export function TrustBackendPart(props: TrustBackendPartProps) { const navigate = useNavigate(); const backendUrl = useBackendUrl(); const hostname = useMemo( - () => (backendUrl ? new URL(backendUrl).hostname : ""), + () => (backendUrl ? new URL(backendUrl).hostname : undefined), [backendUrl], ); const result = useAsync(() => { @@ -54,38 +54,52 @@ export function TrustBackendPart(props: TrustBackendPartProps) { return ( } > - - - + {hostname ? ( + + + + ) : ( +

{t("auth.trust.noHost")}

+ )}
-
- {cardContent} -
- - - - -

- - . - -

+ {hostname ? ( + <> +
+ {cardContent} +
+ + + + +

+ + . + +

+ + ) : ( + + + + )}
); }