var myDataRef = new Firebase('firebase path');
myDataRef.authWithCustomToken(firebaseToken, function(error, authData) {
if (error) {
console.log("Login Failed!", error);
} else {
console.log("Login Succeeded!", authData);
}
});
我的代码如上所述现在我更改为以下代码,以便从firebase.com迁移到firebase.google.com **
var config = {
apiKey: "apikey",
authDomain: "domain",
databaseURL: "firebase path",
storageBucket: "storage",
};
firebase.initializeApp(config);
firebase.auth().signInWithCustomToken(firebaseToken).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// ...
});
使用相同令牌的新代码,它表示无效令牌**