小编Rah*_*hul的帖子

firebase.auth(...).signInWithEmailAndPassword 不是 Cloud Function 中的函数

调用函数时出现错误。我正在使用 LsignInWithEmailAndPassword 方法。需要任何特殊配置吗?

const functions = require('firebase-functions');
    const firebase=require('firebase-admin');
    firebase.initializeApp(functions.config().firebase);


     exports.login = functions.https.onRequest((request, response) => {


               var data = {
      email    : 'demo@gmail.com',
      password : 'demo123'
    };
    var auth = null;
    firebase
      .auth()
      .signInWithEmailAndPassword(data.email, data.password)
      .then( function(user){
        response.send("Authenticated successfully with payload");
      //  console.log("Authenticated successfully with payload:", user);
        auth = user;
      })
      .catch(function(error){
        response.send("Login Failed!");
      //  console.log("Login Failed!", error);
      });
            //  response.send("Hello from Firebase!");
     });
Run Code Online (Sandbox Code Playgroud)

javascript firebase google-cloud-functions firebase-admin

5
推荐指数
1
解决办法
4150
查看次数

如何停止Firebase Web应用程序中的自动重新加载数据?

当我更改Firebase数据库时,我的Web应用程序会自动重新加载数据,而无需刷新我的网页。我只想停止此功能。

firebase firebase-realtime-database

-1
推荐指数
1
解决办法
691
查看次数