发生Firebase身份验证错误

时间:2018-06-26 03:50:05

标签: node.js firebase vue.js firebase-authentication

我正在使用firebaseui方法在vuejs中进行Firebase身份验证。但是我遇到了这个错误

Could not find the FirebaseUI widget element on the page. 

这是我的代码

var config = {
apiKey: "some api key",
authDomain: "sample-1234.firebaseapp.com",
databaseURL: "https://sample-1234.firebaseio.com",
projectId: "sample-1234",
storageBucket: "sample-1234.appspot.com",
messagingSenderId: "123456789",
clientId: "2565985323215244u7hf3lc6k.apps.googleusercontent.com"
};
var app = firebase.initializeApp(config);
var auth = app.auth(); 
var uiConfig = {
signInSuccessUrl: 'http://localhost:8080/',
signInOptions: [{
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
}],
tosUrl: '<your-tos-url>'
};
var ui = new firebaseui.auth.AuthUI(auth);
console.log(ui);
ui.start('#firebaseui-auth-container', uiConfig);

0 个答案:

没有答案