Bug
Visiting /refer while signed out correctly redirects to /login?next=/refer, but LoginForm always routes a successful sign-in to /account. The intended destination is lost.
Reproduction
- Sign out.
- Open
/refer.
- Sign in successfully.
Expected: the browser returns to /refer.
Actual: the browser navigates to /account.
Proposed fix
Honor a validated internal next path after login and fall back to /account for missing, absolute, protocol-relative, or backslash-based destinations.
Bug
Visiting
/referwhile signed out correctly redirects to/login?next=/refer, butLoginFormalways routes a successful sign-in to/account. The intended destination is lost.Reproduction
/refer.Expected: the browser returns to
/refer.Actual: the browser navigates to
/account.Proposed fix
Honor a validated internal
nextpath after login and fall back to/accountfor missing, absolute, protocol-relative, or backslash-based destinations.