为什么我的Firebase请求返回为500(内部服务器错误)?

问题描述:

我有以下代码不执行(我得到500内部服务器错误)。为什么我的Firebase请求返回为500(内部服务器错误)?

我做错了什么?

app.post('/api/sign-in', function (req, res, next) { 
    //auth 
    firebase.auth().signInWithEmailAndPassword(req.query.username, req.query.password) 
     //get back promise, log user object's email address 
     .then(function (user) { 
      console.log(user.email) 
     }) 
     //log error 
     .catch(function (error) { 
      console.log(error); 
     }) 
}); 
+0

你可以发表你的console.log(错误)的输出? – pupuupup

+0

没有输出。 npm start不运行。 – huzal12

我想你使用的是请求,那么你必须使用req.body代替:

req.body.username, req.body.password 
+0

我修好了。但我仍然得到'未处理的错误'错误。 – huzal12

+0

没关系它的作品!谢谢!! – huzal12