Javascript Firebase Google Auth不在Safari上工作
我有一个功能:Javascript Firebase Google Auth不在Safari上工作,javascript,firebase,safari,firebase-authentication,Javascript,Firebase,Safari,Firebase Authentication,我有一个功能: function loginWithGoogle () { firebase.auth().signInWithRedirect(provider); } firebase.auth().getRedirectResult().then(function(result) { if (result.credential) { // This gives you a Google Access Token. You can use it
function loginWithGoogle () {
firebase.auth().signInWithRedirect(provider);
}
firebase.auth().getRedirectResult().then(function(result) {
if (result.credential) {
// This gives you a Google Access Token. You can use it to access the Google API.
var token = result.credential.accessToken;
}
var user = result.user; // The signed-in user info.
}).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
var email = error.email; // The email of the user's account used.
var credential = error.credential; // The firebase.auth.AuthCredential type that was used.
});
当用户单击登录按钮时运行。但是,这在Safari(使用移动仿真器和我的桌面)上似乎不起作用。代码在Chrome上正常运行。我是否需要添加其他内容以确保支持Safari?谢谢 登录弹出窗口打开了吗?如果是这样,它是否进入catch{}块?此外,如果您注意到任何控制台错误,请与他人分享。一般来说,它应该按预期工作,但也要确保它不会阻止弹出窗口。@VeereshDevireddy啊,我忽略了为我的x.com网站添加身份验证登录(只添加了www.x.com)。非常感谢。