angular-intercom icon indicating copy to clipboard operation
angular-intercom copied to clipboard

CORS Issue - Annyone else getting this?

Open Skylude opened this issue 9 years ago • 4 comments

XMLHttpRequest cannot load https://api-ping.intercom.io/vjs/users/ping. No 'Access-Control-Allow-Origin' header is present on the requested resource.

This is when using the script from inside angular instead of putting the script directly on the page.

Skylude avatar Feb 27 '16 01:02 Skylude

Seems to be ok for me. Does the issue still happen for you? The Intercom ping endpoint always returns Access-Control-Allow-Origin: *, so there's no reason why it would be broken.

yjwong avatar Feb 28 '16 18:02 yjwong

Yeah it's still happening. I'll do some more digging tomorrow. If I include the script normally in html it works but when I use async loading it throws that error. Thanks for getting back to me!

On Feb 28, 2016, at 11:02 AM, Wong Yong Jie [email protected] wrote:

Seems to be ok for me. Does the issue still happen for you? The Intercom ping endpoint always returns Access-Control-Allow-Origin: *, so there's no reason why it would be broken.

— Reply to this email directly or view it on GitHub.

Skylude avatar Feb 28 '16 18:02 Skylude

Just a quick update the problem was I was sending a parameter called "companies" as a javascript list instead of company. For some reason this threw a CORS error and NOT a typical 500 response. One other question I have for you is secure mode found here, https://docs.intercom.io/configuring-intercom/enable-secure-mode

Do you plan on supporting this?

Thanks again!

Date: Sun, 28 Feb 2016 10:02:49 -0800 From: [email protected] To: [email protected] CC: [email protected] Subject: Re: [angular-intercom] CORS Issue - Annyone else getting this? (#30)

Seems to be ok for me. Does the issue still happen for you? The Intercom ping endpoint always returns Access-Control-Allow-Origin: *, so there's no reason why it would be broken.

— Reply to this email directly or view it on GitHub.

Skylude avatar Mar 01 '16 00:03 Skylude

That's interesting - Secure mode is actually supported, you just have to send the user_hash as part of the user options.

$intercom.boot({
    'user_hash': ...
    ... // Rest of user properties
});

You can generate the user_hash on the server-side.

yjwong avatar Mar 09 '16 11:03 yjwong