我按照这篇文章为使用 Firebase 作为后端服务的 Ionic App 创建了 OAuth。能够在 Ionic Lab 中调出应用程序,并且可以看到社交图标。但是当我点击任何图标时,什么都没有发生。
只知道我的代码使用了cordova-plugin-inappbrowser
,我对此知之甚少。当我点击相应的图标时,我除了一个 Facebook 或 Twitter 弹出窗口来显示,但它似乎没有。
我在控制台中看到以下错误:
当我点击 Facebook 图标时:
Refused to display 'https://www.facebook.com/login.php?
skip_api_login=1&api_key=150011636022826…
&display=popup&locale=en_US&logger_id=fe62445f-81aa-405e-b35f-
80f8fd220707' in a frame because it set 'X-Frame-Options' to 'DENY'.
当我点击 Twitter 图标时:
Refused to display 'https://api.twitter.com/oauth/authenticate?
oauth_token=nSzk7gAAAAAAuTInAAABV456ulg' in a frame because an ancestor
violates the following Content Security Policy directive: "frame-ancestors
'self' https://tweetdeck.twitter.com https://tdapi-
staging.smf1.twitter.com https://tdapi-staging.atla.twitter.com
https://tweetdeck.localhost.twitter.com".`
我该怎么做才能纠正这个问题?
当我手动执行时ionic serve
,应用程序会在浏览器中加载,当我单击 Facebook 图标时,我可以将页面重定向到 Facebook 登录。
PS:我对这个 Ionic 框架只有一天的时间。