From fd3c0d9fc63fd403ed9a965baf7bea45d4c0ee20 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 21 Dec 2022 09:27:25 +0000 Subject: [PATCH] Don't guess the server name from the URL It only uses the default HS URL anywayso just use the default server name. --- src/auth/LoginPage.tsx | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/auth/LoginPage.tsx b/src/auth/LoginPage.tsx index a6b0af99..88296db4 100644 --- a/src/auth/LoginPage.tsx +++ b/src/auth/LoginPage.tsx @@ -14,14 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, { - FC, - FormEvent, - useCallback, - useRef, - useState, - useMemo, -} from "react"; +import React, { FC, FormEvent, useCallback, useRef, useState } from "react"; import { useHistory, useLocation, Link } from "react-router-dom"; import { Trans, useTranslation } from "react-i18next"; @@ -75,12 +68,6 @@ export const LoginPage: FC = () => { [login, location, history, homeserver, setClient] ); - const homeserverHost = useMemo(() => { - // XXX: This isn't really correct: the server name of an HS may not - // be the same as the hostname of the client API endpoint. - return new URL(homeserver).host; - }, [homeserver]); - return ( <>
@@ -100,7 +87,7 @@ export const LoginPage: FC = () => { autoCorrect="off" autoCapitalize="none" prefix="@" - suffix={`:${homeserverHost}`} + suffix={`:${Config.defaultServerName()}`} />