简体   繁体   English

在使用cognito进行身份验证时,IE11上的提取未定义

[英]Fetch is undefined on IE11 when authenticating with cognito

I have an ember app where I log on and it authenticates me using ember-cognito and ember-simple-auth. 我有一个我登录的ember应用程序,它使用ember-cognito和ember-simple-auth对我进行身份验证。

this.get('sessionService').authenticate('authenticator:cognito', credentials).then(() => {
         console.log('authenticated');
    }).catch(( reason ) => {

        console.log(reason);
    });

This works on every browser except ie which i get the error 'fetch is not defined'. 这适用于每个浏览器,除了我得到错误'fetch未定义'。

This appears in the catch section which means cognito is trying to use fetch. 这出现在catch部分,这意味着cognito正在尝试使用fetch。

I have been looking into this but cant find a solution for my scenario. 我一直在研究这个,但无法找到适合我的方案的解决方案。

Just include isomorphic-fetch as polyfill to make it work on unsupported browsers. 只需将isomorphic-fetch包含为polyfill,即可在不受支持的浏览器上运行。

https://github.com/matthew-andrews/isomorphic-fetch https://github.com/matthew-andrews/isomorphic-fetch

Please install isomorphic-fetch polyfill : 请安装isomorphic-fetch polyfill:

npm install --save isomorphic-fetch es6-promise npm install --save isomorphic-fetch es6-promise

For more info visit here 欲了解更多信息请访问这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM