Skip to content

Commit 0716434

Browse files
committed
Allow hs_url as param on mobile_register
1 parent a89f61a commit 0716434

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/components/structures/MatrixChat.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -961,9 +961,16 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
961961
view: Views.REGISTER,
962962
};
963963

964-
// Only honour params if they are all present, otherwise we reset
965-
// HS and IS URLs when switching to registration.
966-
if (params.client_secret && params.session_id && params.hs_url && params.is_url && params.sid) {
964+
if (isMobileRegistration && params.hs_url) {
965+
try {
966+
const config = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(params.hs_url);
967+
newState.serverConfig = config;
968+
} catch (err) {
969+
logger.warn("Failed to load hs_url param:", params.hs_url);
970+
}
971+
} else if (params.client_secret && params.session_id && params.hs_url && params.is_url && params.sid) {
972+
// Only honour params if they are all present, otherwise we reset
973+
// HS and IS URLs when switching to registration.
967974
newState.serverConfig = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(
968975
params.hs_url,
969976
params.is_url,

0 commit comments

Comments
 (0)