From 9e80f56eae4ab34814162d73e67fcb87154d6776 Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Mon, 13 Jul 2026 19:55:20 +0200 Subject: [PATCH 1/2] Hide register link when registration is disabled --- src/app/pages/auth/login/Login.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/pages/auth/login/Login.tsx b/src/app/pages/auth/login/Login.tsx index 2aa6fc8a5b..8598a25a04 100644 --- a/src/app/pages/auth/login/Login.tsx +++ b/src/app/pages/auth/login/Login.tsx @@ -2,7 +2,7 @@ import { useMemo } from 'react'; import { Box, Text, color } from 'folds'; import { Link, useSearchParams } from 'react-router-dom'; import { SSOAction } from '$types/matrix-sdk'; -import { useAuthFlows } from '$hooks/useAuthFlows'; +import { RegisterFlowStatus, useAuthFlows } from '$hooks/useAuthFlows'; import { useAuthServer } from '$hooks/useAuthServer'; import { useParsedLoginFlows } from '$hooks/useParsedLoginFlows'; import { getLoginPath, getRegisterPath, withSearchParam } from '$pages/pathUtils'; @@ -38,7 +38,7 @@ export function Login() { const server = useAuthServer(); const { hashRouter } = useClientConfig(); const { hideUsernamePasswordFields } = useClientConfig(); - const { loginFlows } = useAuthFlows(); + const { loginFlows, registerFlows } = useAuthFlows(); const [searchParams] = useSearchParams(); const loginSearchParams = useLoginSearchParams(searchParams); const ssoRedirectUrl = usePathWithOrigin(getLoginPath(server)); @@ -61,6 +61,9 @@ export function Login() { ? withSearchParam(getRegisterPath(server), { addAccount: '1' }) : getRegisterPath(server); + const registrationUnavailable = + registerFlows.status === RegisterFlowStatus.RegistrationDisabled && !parsedFlows.sso; + return ( @@ -98,9 +101,11 @@ export function Login() { )} - - Do not have an account? Register - + {!registrationUnavailable && ( + + Do not have an account? Register + + )} ); } From 3e4acb7985959a7d8381d063d6ce85da21954423 Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Mon, 13 Jul 2026 20:08:47 +0200 Subject: [PATCH 2/2] Add changeset --- .changeset/hide-register-when-disabled.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/hide-register-when-disabled.md diff --git a/.changeset/hide-register-when-disabled.md b/.changeset/hide-register-when-disabled.md new file mode 100644 index 0000000000..20e558b331 --- /dev/null +++ b/.changeset/hide-register-when-disabled.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Hide the "Register" link on the login page when the homeserver has registration disabled and offers no SSO to register through, so you are no longer sent to a dead-end registration page.