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