def METHOD_NAME(self):
    sso_session_expired = SsoSession(
        self.organization.id,
        datetime.now(tz=timezone.utc) - SSO_EXPIRY_TIME - timedelta(hours=1),
    )
    self.session[sso_session_expired.session_key] = sso_session_expired.to_dict()
    self.save_session()
    resp = self.client.get(
        f"/api/0/teams/{self.organization.slug}/{self.team.slug}/",
        HTTP_REFERER="http://example.com",
    )
    assert resp.json()["detail"]["extra"]["loginUrl"] == "/auth/login/foo/"