Meteor app - facebook login - popup doesn't close

两盒软妹~` 提交于 2019-12-24 01:22:34

问题


My meteor app login with facebook seems to work properly except that the login popup never closes. The popup window stays open until the app is reloaded. I don't even where to start to debug this... The popup is blank and the inspect reveals :

<p id="completedText" style="display:none;">
    Login completed. <a href="#" onclick="window.close()">
      Click here</a> to close this window.
  </p>

The style=display:none is probably why the popup appears blank but I don't know how to update that style. Also, if I perform a window.close() from the console, the popup disappears but the app doesn't register the login.

BTW, this bug only appears when I use my app from my domain name, when I call it from the IP address, it works just fine.


回答1:


I was experiencing the same issue, when I started using accounts-google.

It was because I was mixing http and https in my redirect URL.




回答2:


Apparently this is a known bug with iOS and can be solved by changing the loginStyle parameters:

Usually, the popup-based flow is preferable because the user will not have to reload your whole app at the end of the login flow. However, the popup-based flow requires browser features such as window.close and window.opener that are not available in all mobile environments. In particular, we recommend using Meteor.loginWith({ loginStyle: "redirect" }) in the following environments:

Inside UIWebViews (when your app is loaded inside a mobile app) In Safari on iOS8 (window.close is not supported due to a bug)

Meteor docs



来源:https://stackoverflow.com/questions/35896610/meteor-app-facebook-login-popup-doesnt-close

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!