## Bug description

When opening an invite link and then using SAML to sign up, you don't actually accept the invite, and you're only allowed to sign up if your email address's domain matches the domain whitelist. This happens because for some reason the session state (where the invite ID is stored) is not kept throughout the SAML flow. During the callback to PH, the state appears blank.

## Expected behavior

When opening an invite link and using SAML to sign up, I expect to be able to sign up as with any other SSO and get rejected if my email address does not match the one on the invite.


## How to reproduce

1. Create an invite link
2. Try signing up with SAML
3. See a signup error message

## Environment

- [ ] PostHog Cloud
- [X] self-hosted PostHog, version/commit: _please provide_

## Additional context

@Twixes would you be able to pick this up? Think you have strong context on social login to figure it out (is not particularly a SAML problem).

#### *Thank you* for your bug report – we love squashing them!
posthog/api/signup.py
"""
    Signup serializer when the account is created using social authentication.
    Pre-processes information not obtained from SSO provider to create organization.
    """
    organization_name: serializers.Field = serializers.CharField(max_length=128)
    email_opt_in: serializers.Field = serializers.BooleanField(default=True)
    def create(self, validated_data, **kwargs):
        request = self.context["request"]
        if not request.session.get("backend"):
            raise serializers.ValidationError(
                "Inactive social login session. Go to /login and log in before continuing.",
            )
        request.session["organization_name"] = validated_data["organization_name"]
        request.session["email_opt_in"] = validated_data["email_opt_in"]
        request.session.set_expiry(3600)  
        return {"continue_url": reverse("social:complete", args=[request.session["backend"]])}
    def to_representation(self, instance: Any) -> Any:
        return self.instance
class SocialSignupViewset(generics.CreateAPIView):
    serializer_class = SocialSignupSerializer
    permission_classes = (CanCreateOrg,)
class TeamInviteSurrogate: