Skip to content

Commit 95175ca

Browse files
authored
Remove redundant MSC implementation for io.element.rendezvous (element-hq#28583)
Signed-off-by: Michael Telatynski <[email protected]>
1 parent 08418c1 commit 95175ca

File tree

4 files changed

+5
-26
lines changed

4 files changed

+5
-26
lines changed

src/components/views/auth/LoginWithQR.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,9 @@ export default class LoginWithQR extends React.Component<IProps, IState> {
108108
private generateAndShowCode = async (): Promise<void> => {
109109
let rendezvous: MSC4108SignInWithQR;
110110
try {
111-
const fallbackRzServer = this.props.client?.getClientWellKnown()?.["io.element.rendezvous"]?.server;
112-
113111
const transport = new MSC4108RendezvousSession({
114112
onFailure: this.onFailure,
115113
client: this.props.client,
116-
fallbackRzServer,
117114
});
118115
await transport.send("");
119116
const channel = new MSC4108SecureChannel(transport, undefined, this.onFailure);

src/components/views/settings/devices/LoginWithQRSection.tsx

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@ Please see LICENSE files in the repository root for full details.
77
*/
88

99
import React from "react";
10-
import {
11-
IServerVersions,
12-
IClientWellKnown,
13-
OidcClientConfig,
14-
MatrixClient,
15-
DEVICE_CODE_SCOPE,
16-
} from "matrix-js-sdk/src/matrix";
10+
import { IServerVersions, OidcClientConfig, MatrixClient, DEVICE_CODE_SCOPE } from "matrix-js-sdk/src/matrix";
1711
import QrCodeIcon from "@vector-im/compound-design-tokens/assets/web/icons/qr-code";
1812
import { Text } from "@vector-im/compound-web";
1913

@@ -25,7 +19,6 @@ import { useMatrixClientContext } from "../../../../contexts/MatrixClientContext
2519
interface IProps {
2620
onShowQr: () => void;
2721
versions?: IServerVersions;
28-
wellKnown?: IClientWellKnown;
2922
oidcClientConfig?: OidcClientConfig;
3023
isCrossSigningReady?: boolean;
3124
}
@@ -35,10 +28,8 @@ export function shouldShowQr(
3528
isCrossSigningReady: boolean,
3629
oidcClientConfig?: OidcClientConfig,
3730
versions?: IServerVersions,
38-
wellKnown?: IClientWellKnown,
3931
): boolean {
40-
const msc4108Supported =
41-
!!versions?.unstable_features?.["org.matrix.msc4108"] || !!wellKnown?.["io.element.rendezvous"]?.server;
32+
const msc4108Supported = !!versions?.unstable_features?.["org.matrix.msc4108"];
4233

4334
const deviceAuthorizationGrantSupported =
4435
oidcClientConfig?.metadata?.grant_types_supported.includes(DEVICE_CODE_SCOPE);
@@ -51,15 +42,9 @@ export function shouldShowQr(
5142
);
5243
}
5344

54-
const LoginWithQRSection: React.FC<IProps> = ({
55-
onShowQr,
56-
versions,
57-
wellKnown,
58-
oidcClientConfig,
59-
isCrossSigningReady,
60-
}) => {
45+
const LoginWithQRSection: React.FC<IProps> = ({ onShowQr, versions, oidcClientConfig, isCrossSigningReady }) => {
6146
const cli = useMatrixClientContext();
62-
const offerShowQr = shouldShowQr(cli, !!isCrossSigningReady, oidcClientConfig, versions, wellKnown);
47+
const offerShowQr = shouldShowQr(cli, !!isCrossSigningReady, oidcClientConfig, versions);
6348

6449
return (
6550
<SettingsSubsection heading={_t("settings|sessions|sign_in_with_qr")}>

src/components/views/settings/tabs/user/SessionManagerTab.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
66
Please see LICENSE files in the repository root for full details.
77
*/
88

9-
import React, { lazy, Suspense, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
9+
import React, { lazy, Suspense, useCallback, useContext, useEffect, useRef, useState } from "react";
1010
import { discoverAndValidateOIDCIssuerWellKnown, MatrixClient } from "matrix-js-sdk/src/matrix";
1111
import { logger } from "matrix-js-sdk/src/logger";
1212
import { defer } from "matrix-js-sdk/src/utils";
@@ -184,7 +184,6 @@ const SessionManagerTab: React.FC<{
184184
const userId = matrixClient?.getUserId();
185185
const currentUserMember = (userId && matrixClient?.getUser(userId)) || undefined;
186186
const clientVersions = useAsyncMemo(() => matrixClient.getVersions(), [matrixClient]);
187-
const wellKnown = useMemo(() => matrixClient?.getClientWellKnown(), [matrixClient]);
188187
const oidcClientConfig = useAsyncMemo(async () => {
189188
try {
190189
const authIssuer = await matrixClient?.getAuthIssuer();
@@ -305,7 +304,6 @@ const SessionManagerTab: React.FC<{
305304
<LoginWithQRSection
306305
onShowQr={onShowQrClicked}
307306
versions={clientVersions}
308-
wellKnown={wellKnown}
309307
oidcClientConfig={oidcClientConfig}
310308
isCrossSigningReady={isCrossSigningReady}
311309
/>

test/unit-tests/components/views/settings/devices/LoginWithQRSection-test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ describe("<LoginWithQRSection />", () => {
5656
const defaultProps = {
5757
onShowQr: () => {},
5858
versions: makeVersions({ "org.matrix.msc4108": true }),
59-
wellKnown: {},
6059
};
6160

6261
const getComponent = (props = {}) => <LoginWithQRSection {...defaultProps} {...props} />;

0 commit comments

Comments
 (0)