## 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
return HttpResponse(processed, status=401)
        try:
            invite.validate(user=None, email=user_email)
        except ValueError as e:
            processed = render_to_string("auth_error.html", {"message": str(e)},)
            return HttpResponse(processed, status=401)
        try:
            user = strategy.create_user(email=user_email, first_name=user_name, password=None)
        except Exception as e:
            capture_exception(e)
            processed = render_to_string(
                "auth_error.html",
                {
                    "message": "Account unable to be created. This account may already exist. Please try again or use different credentials!"
                },
            )
            return HttpResponse(processed, status=401)
        invite.use(user, prevalidated=True)
    posthoganalytics.capture(
        user.distinct_id,
        "user signed up",
        properties={
            "is_first_user": User.objects.count() == 1,
            "is_first_team_user": not from_invite,
            "login_provider": backend.name,
        },
    )
    return {"is_new": True, "user": user}
@csrf_protect
def logout(request):