Switch to importing most things from the main matrix-js-sdk export (#11406)

* Switch to importing most things from the main matrix-js-sdk export

* fix imports

* Iterate

* Fix tests
This commit is contained in:
Michael Telatynski 2023-08-15 16:00:17 +01:00 committed by GitHub
parent 0842559fb2
commit ad73b0c16e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 262 additions and 277 deletions

View file

@ -24,11 +24,12 @@ import {
IRegisterRequestParams,
IRequestTokenResponse,
MatrixClient,
SSOFlow,
SSOAction,
} from "matrix-js-sdk/src/matrix";
import React, { Fragment, ReactNode } from "react";
import classNames from "classnames";
import { logger } from "matrix-js-sdk/src/logger";
import { ISSOFlow, SSOAction } from "matrix-js-sdk/src/@types/auth";
import { RegisterResponse } from "matrix-js-sdk/src/@types/registration";
import { _t } from "../../../languageHandler";
@ -121,7 +122,7 @@ interface IState {
differentLoggedInUserId?: string;
// the SSO flow definition, this is fetched from /login as that's the only
// place it is exposed.
ssoFlow?: ISSOFlow;
ssoFlow?: SSOFlow;
}
export default class Registration extends React.Component<IProps, IState> {
@ -219,11 +220,11 @@ export default class Registration extends React.Component<IProps, IState> {
this.loginLogic.setHomeserverUrl(hsUrl);
this.loginLogic.setIdentityServerUrl(isUrl);
let ssoFlow: ISSOFlow | undefined;
let ssoFlow: SSOFlow | undefined;
try {
const loginFlows = await this.loginLogic.getFlows();
if (serverConfig !== this.latestServerConfig) return; // discard, serverConfig changed from under us
ssoFlow = loginFlows.find((f) => f.type === "m.login.sso" || f.type === "m.login.cas") as ISSOFlow;
ssoFlow = loginFlows.find((f) => f.type === "m.login.sso" || f.type === "m.login.cas") as SSOFlow;
} catch (e) {
if (serverConfig !== this.latestServerConfig) return; // discard, serverConfig changed from under us
logger.error("Failed to get login flows to check for SSO support", e);