fix(sign-in): detect register mode from URL path, not just query param
All checks were successful
CI / build (push) Successful in 1m19s
CI / docker (push) Successful in 44s

Newer Logto versions redirect to /register?app_id=... instead of
/sign-in?first_screen=register. Check the pathname in addition to
the query param so the registration form shows correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-25 10:10:57 +02:00
parent 5cc9f8c9ef
commit 0cfa359fc5

View File

@@ -54,7 +54,9 @@ function pickRandom(arr: string[]) {
function getInitialMode(): Mode { function getInitialMode(): Mode {
const params = new URLSearchParams(window.location.search); const params = new URLSearchParams(window.location.search);
return params.get('first_screen') === 'register' ? 'register' : 'signIn'; if (params.get('first_screen') === 'register') return 'register';
if (window.location.pathname.endsWith('/register')) return 'register';
return 'signIn';
} }
export function SignInPage() { export function SignInPage() {