From 0ab51bc59d97338c161d20c494317dd3d6ddc072 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 3 Oct 2023 11:05:35 +0100 Subject: [PATCH] Update AutoDiscoveryUtils.tsx --- src/utils/AutoDiscoveryUtils.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/AutoDiscoveryUtils.tsx b/src/utils/AutoDiscoveryUtils.tsx index 607423b37a..5c7276c829 100644 --- a/src/utils/AutoDiscoveryUtils.tsx +++ b/src/utils/AutoDiscoveryUtils.tsx @@ -17,6 +17,7 @@ limitations under the License. import React, { ReactNode } from "react"; import { AutoDiscovery, + AutoDiscoveryError, ClientConfig, OidcClientConfig, M_AUTHENTICATION, @@ -210,7 +211,7 @@ export default class AutoDiscoveryUtils { } else if (isResult && isResult.state !== AutoDiscovery.PROMPT) { logger.error("Error determining preferred identity server URL:", isResult); if (isResult.state === AutoDiscovery.FAIL_ERROR) { - if (AutoDiscovery.ALL_ERRORS.indexOf(isResult.error as string) !== -1) { + if (AutoDiscovery.ALL_ERRORS.indexOf(isResult.error as AutoDiscoveryError) !== -1) { // XXX: We mark these with _td at the top of Login.tsx - we should come up with a better solution throw new UserFriendlyError(String(isResult.error) as TranslationKey); } @@ -227,7 +228,7 @@ export default class AutoDiscoveryUtils { if (hsResult.state !== AutoDiscovery.SUCCESS) { logger.error("Error processing homeserver config:", hsResult); if (!syntaxOnly || !AutoDiscoveryUtils.isLivelinessError(hsResult.error)) { - if (AutoDiscovery.ALL_ERRORS.indexOf(hsResult.error as string) !== -1) { + if (AutoDiscovery.ALL_ERRORS.indexOf(hsResult.error as AutoDiscoveryError) !== -1) { // XXX: We mark these with _td at the top of Login.tsx - we should come up with a better solution throw new UserFriendlyError(String(hsResult.error) as TranslationKey); }