diff --git a/packages/@uppy/companion-client/src/Provider.js b/packages/@uppy/companion-client/src/Provider.js index 2d109b5ea7..a3a5bf2a9f 100644 --- a/packages/@uppy/companion-client/src/Provider.js +++ b/packages/@uppy/companion-client/src/Provider.js @@ -114,12 +114,14 @@ export default class Provider extends RequestClient { const authWindow = window.open(link, '_blank') const handleToken = (e) => { if (e.source !== authWindow) { - reject(new Error('rejecting event from unknown source')) + this.uppy.log.warn('ignoring event from unknown source', e) + return } const { companionAllowedHosts } = this.uppy.getPlugin(this.pluginId).opts - if (!isOriginAllowed(e.origin, companionAllowedHosts) || e.source !== authWindow) { + if (!isOriginAllowed(e.origin, companionAllowedHosts)) { reject(new Error(`rejecting event from ${e.origin} vs allowed pattern ${companionAllowedHosts}`)) + return } // Check if it's a string before doing the JSON.parse to maintain support