如何使用Firebase管理节点js使用用户名和密码登录

时间:2019-07-03 14:27:42

标签: node.js firebase firebase-authentication

我想用firebase admin node js来登录用户名和密码,我曾经使用过代码,但它只使用了getUserByEmail,我还想比较密码,请问有人可以帮我怎么做那,我已经尝试过了,有人可以帮我怎么做吗?

export const authlogin = functions.https.onRequest((req, res) => {
  const email = 'user@example.com';
  //const password = 'testing123';
  admin.auth().getUserByEmail(email)
    .then(function (userRecordEmail) {
        res.send({ 'status': 1, 'id': userRecordEmail});
    })
    .catch(function (error) {
      res.send({ 'status': 0, 'msg': error });
    });
});

0 个答案:

没有答案