firebase javascript令牌生成器

时间:2016-06-09 12:33:20

标签: javascript firebase google-app-engine firebase-authentication

    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;
      // ...
    });

使用相同令牌的新代码,它表示无效令牌**

0 个答案:

没有答案