## 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
from typing import Any, Dict, Optional, Union, cast
import posthoganalytics
from django import forms
from django.conf import settings
from django.contrib.auth import login, password_validation
from django.core.exceptions import ValidationError
from django.db import IntegrityError, transaction
from django.shortcuts import redirect, render
from django.urls.base import reverse
from rest_framework import exceptions, generics, permissions, response, serializers, validators
from sentry_sdk import capture_exception
from social_core.pipeline.partial import partial
from social_django.strategy import DjangoStrategy
from posthog.api.shared import UserBasicSerializer
from posthog.demo import create_demo_team
from posthog.event_usage import report_user_joined_organization, report_user_signed_up
from posthog.models import Organization, Team, User
from posthog.models.organization import OrganizationInvite
from posthog.permissions import CanCreateOrg
from posthog.tasks import user_identify
from posthog.utils import get_can_create_org, mask_email_address
class SignupSerializer(serializers.Serializer):