Question

CORS policy is being blocked for a user

  • 25 April 2023
  • 6 replies
  • 46 views

Badge

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

Userlevel 7
Badge +5

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

Badge

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

Userlevel 7
Badge +5

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? 

Badge

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);
}
});
}

 

Userlevel 7
Badge +5

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

Userlevel 7
Badge +5

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