## How to reproduce

1. Log out
2. Open a specific PH link (e.g. https://<PH instance>/person/338)
3. Login

## Expected behavior

I expect it to take me to the page I was intending to go to when I was logged out and not "Insights" page.

## Actual behavior

It takes me to the https://<PH instance>/insights...

## Environment

- PostHog cloud or self-managed? self-hosted
- PostHog version/commit: 1.17.0
posthog/urls.py
if inp_type == "email":
        return len(val) > 2 and val.count("@") > 0
    return len(val) > 0
try:
    from ee.urls import extend_api_router
except ImportError:
    pass
else:
    extend_api_router(router, projects_router=projects_router)
def opt_slash_path(route: str, view: Callable, name: Optional[str] = None) -> str:
    """Catches path with or without trailing slash, taking into account query param and hash."""
    return re_path(route=fr"^{route}/?(?:[?#].*)?$", view=view, name=name)
urlpatterns = [
    
    opt_slash_path("_health", health),
    opt_slash_path("_stats", stats),
    opt_slash_path("_preflight", preflight_check),
    opt_slash_path("_system_status", system_status),
    
    path("admin/", admin.site.urls),
    path("admin/", include("loginas.urls")),