fix(sign-in): detect register mode from URL path, not just query param
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:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user