## 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
"invite_id": invite_id,
                    },
                )
            else:
                posthoganalytics.capture(
                    user.distinct_id, "user joined from invite", properties={"organization_id": organization.id},
                )
                return redirect("/")
        else:
            email = request.POST["email"]
            password = request.POST["password"]
            first_name = request.POST.get("name")
            email_opt_in = request.POST.get("emailOptIn") == "on"
            valid_inputs = (
                is_input_valid("name", first_name)
                and is_input_valid("email", email)
                and is_input_valid("password", password)
            )
            already_exists = User.objects.filter(email=email).exists()
            custom_error = None
            try:
                invite.validate(user=None, email=email)
            except ValueError as e:
                custom_error = str(e)
            if already_exists or not valid_inputs or custom_error:
                return render_template(
                    "signup_to_organization.html",
                    request=request,
                    context={
                        "email": email,