我已经创建了一个Firebase帐户,并将其与我的React代码关联:
我填写了您在上图中看到的所有字段,但是当我尝试从React屏幕登录时:
当我在React代码中使用它时:
import firebase from "firebase/app";
import "firebase/firestore";
import "firebase/auth";
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "xxxxxxxxxxxx",
authDomain: "xxxxxxxxxxxx.firebaseapp.com",
databaseURL: "https://xxxxxxxxxxxx.firebaseio.com",
projectId: "xxxxxxxxxxx-1e2be",
storageBucket: "",
messagingSenderId: "xxxxxxxxxxxxxxxxx",
appId: "xxxxxxxxxxxxxxxxxx"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
export const auth = firebase.auth();
export const firestore = firebase.firestore();
const provider = new firebase.auth.GoogleAuthProvider();
provider.setCustomParameters({ prompt: 'select_account' });
export const signInWithGoogle = () => auth.signInWithPopup(provider);
export default firebase;
运行它,我得到:
可能是什么问题?看起来我拥有所有权限。
那我哪里出错了?
编辑:登录方法已启用,但仍然无效!