CORS policy is being blocked for a user | Community
Skip to main content
Question

CORS policy is being blocked for a user


Forum|alt.badge.img

Hi,

We use embedded Typeforms in our application.

We have a new user on the platform who is getting the above issue.

When the user clicks on the popup, the popup fails to finish loading.

Other users do not have this issue. Is this a due to a security measure and do you have any suggestions?

 

Thanks,

Eoin

 

 

 

6 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14960 replies
  • April 25, 2023

Hi @knockrobin Thanks for stopping by the community. Do you mind sharing the URL where you have the form embedded? Thanks in advance!


Forum|alt.badge.img
  • Author
  • Explorer
  • 6 replies
  • April 25, 2023

Hi Liz, thanks for the response. The url is embedded at https://app.vyra.ie/


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14960 replies
  • April 25, 2023

Thanks, @knockrobin ! It looks like the form is behind a login screen, so I’m unable to see the form. Are you able to share any screenshots of how you’ve embedded the form? 


Forum|alt.badge.img
  • Author
  • Explorer
  • 6 replies
  • April 26, 2023

Hi Liz, we have several users of the platform and up until now there has never been an issue with the embedded typeform. This issue is only occurring with one of our users. For this reason, I think that it might be a security measure in place from this companies IT. However, they can still access the typeform from the url.

 

This is how we embed them:
 

function updateTypeformCards(auto_popup = false) {
  const typeformLinks = document.querySelectorAll('#typeformLink');
  typeformLinks.forEach((elem) => {
    const formID = elem.getAttribute("data-typeform-id");
    const emailStr = elem.getAttribute("data-email");
    const modulePk = elem.getAttribute("data-module-id");
    const firstName = elem.getAttribute("data-first-name");
    const orgName = elem.getAttribute("data-organisation-name");
    const isNext = elem.getAttribute("data-is-next");
    const options = {
      hidden: { email: emailStr, first_name: firstName, organisation_name: orgName },
      onSubmit: (event) => {
        if (formID === "GiV6Ejvn"){
          window.location.href = `/?ready`
        } else {
          fetchTypeform(event.response_id, modulePk)
        }
      },
      autoClose: 3,
    }

    const { open, close, toggle, refresh } = window.tf.createPopup(formID, options)
    elem.onclick = toggle
    var isTrueActive = isNext != null && isNext.replaceAll(' ', '') === 'true';
    if (((window.location.href.indexOf("open")) > -1 || auto_popup) && isTrueActive === true) {
      setTimeout(function () {
        elem.click();
      }, 1000);
    }
  });
}

 


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14960 replies
  • April 26, 2023

@mathio do you happen to know anything about this kind of embed and a CORs issue? 


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • April 27, 2023

Hello,. I dont know, this is a weird error message given it happens for single user only. Just a guess - could be related to their browser. What browser are they using? Can they try opening the popup without any browser extensions?


Reply