From 9bf6c17d6334a129bd4c09cf7e496c81d497cf74 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Sat, 25 Apr 2026 20:06:17 +0200 Subject: [PATCH] fix: hide registration option when sign-in mode is SignIn only Fetch /api/.well-known/sign-in-exp on mount and check signInMode. If not SignInAndRegister, hide the "Sign up" link and force sign-in mode (even if ?first_screen=register was in the URL). Co-Authored-By: Claude Opus 4.6 (1M context) --- ui/sign-in/src/SignInPage.tsx | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/ui/sign-in/src/SignInPage.tsx b/ui/sign-in/src/SignInPage.tsx index 8e08e7f..2bd2312 100644 --- a/ui/sign-in/src/SignInPage.tsx +++ b/ui/sign-in/src/SignInPage.tsx @@ -61,6 +61,7 @@ function getInitialMode(): Mode { export function SignInPage() { const [mode, setMode] = useState(getInitialMode); + const [registrationEnabled, setRegistrationEnabled] = useState(true); const subtitle = useMemo( () => pickRandom(mode === 'signIn' ? SIGN_IN_SUBTITLES : REGISTER_SUBTITLES), [mode === 'signIn' ? 'signIn' : 'register'], @@ -75,6 +76,18 @@ export function SignInPage() { const [error, setError] = useState(null); const [verificationId, setVerificationId] = useState(''); + // Fetch sign-in experience to check if registration is enabled + useEffect(() => { + fetch('/api/.well-known/sign-in-exp') + .then((r) => r.json()) + .then((data) => { + const enabled = data.signInMode === 'SignInAndRegister'; + setRegistrationEnabled(enabled); + if (!enabled && mode !== 'signIn') setMode('signIn'); + }) + .catch(() => {}); + }, []); + // Reset error when switching modes useEffect(() => { setError(null); }, [mode]); @@ -211,12 +224,14 @@ export function SignInPage() { Sign in -

- Don't have an account?{' '} - -

+ {registrationEnabled && ( +

+ Don't have an account?{' '} + +

+ )} )}