调用函数时出现错误。我正在使用 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) 当我更改Firebase数据库时,我的Web应用程序会自动重新加载数据,而无需刷新我的网页。我只想停止此功能。