Update AutoDiscoveryUtils.tsx

pull/28217/head
Michael Telatynski 2023-10-03 11:05:35 +01:00 committed by GitHub
parent ab2aef3f3e
commit 0ab51bc59d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -17,6 +17,7 @@ limitations under the License.
import React, { ReactNode } from "react"; import React, { ReactNode } from "react";
import { import {
AutoDiscovery, AutoDiscovery,
AutoDiscoveryError,
ClientConfig, ClientConfig,
OidcClientConfig, OidcClientConfig,
M_AUTHENTICATION, M_AUTHENTICATION,
@ -210,7 +211,7 @@ export default class AutoDiscoveryUtils {
} else if (isResult && isResult.state !== AutoDiscovery.PROMPT) { } else if (isResult && isResult.state !== AutoDiscovery.PROMPT) {
logger.error("Error determining preferred identity server URL:", isResult); logger.error("Error determining preferred identity server URL:", isResult);
if (isResult.state === AutoDiscovery.FAIL_ERROR) { 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 // 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); throw new UserFriendlyError(String(isResult.error) as TranslationKey);
} }
@ -227,7 +228,7 @@ export default class AutoDiscoveryUtils {
if (hsResult.state !== AutoDiscovery.SUCCESS) { if (hsResult.state !== AutoDiscovery.SUCCESS) {
logger.error("Error processing homeserver config:", hsResult); logger.error("Error processing homeserver config:", hsResult);
if (!syntaxOnly || !AutoDiscoveryUtils.isLivelinessError(hsResult.error)) { 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 // 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); throw new UserFriendlyError(String(hsResult.error) as TranslationKey);
} }