admin管理员组文章数量:1398827
I have a simple snippet involving Firebase Authentication with two options: email/pass and google. My problem is that users can use the option email/pass smoothly. Regarding Google provider, it can redirect to Google's Oauth2 page, where users select and log in with their Google account. It also redirects back to my original page. However, it seems that the successful callback and error callback have never fired. (Note: with user/pass those callbacks fire as expected)
Here is what I tried
- Whitelist domain -> done
- Enable Google Provider in Firebase's console -> done
Are there any tips to debug this issue?
window.addEventListener('load', function () {
document.getElementById('sign-out').onclick = function () {
firebase.auth().signOut();
};
// FirebaseUI config.
var uiConfig = {
signInSuccessUrl: '/',
signInOptions: [
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.EmailAuthProvider.PROVIDER_ID
],
};
firebase.auth().onAuthStateChanged(function (user) {
if (user) {
// if user is signed in, handle business logic here
} else {
// User is signed out.
// Initialize the FirebaseUI Widget using Firebase.
var ui = new firebaseui.auth.AuthUI(firebase.auth());
// Show the Firebase login button.
ui.start('#firebaseui-auth-container', uiConfig);
}
}, function (error) {
console.error("Authentication state change error:", error);
});
});
本文标签: javascriptGoogle provider no response after user loginStack Overflow
版权声明:本文标题:javascript - Google provider no response after user login - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744697043a2620339.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论