简体   繁体   English

使用firebase-tools软件包中的auth:import函数作为node.js模块时出现问题

[英]Trouble using auth:import function from firebase-tools package as a node.js module

Currently, I am trying to import users with already hashed passwords into Firebase by solely using the 'firebase-tools' package. 目前,我正试图仅通过使用“ firebase-tools”软件包将已散列密码的用户导入Firebase。 I am able to list my current projects by using the command: 我可以使用以下命令列出当前项目:

  client.list({ token:fbToken }).then(function(data){ console.log(data); }); 

but am unable to import any users when trying to use the auth:import command. 但是在尝试使用auth:import命令时无法导入任何用户。

  client.auth:import({ account_file: "driverList.json", project:"projectName", token: fbToken, hash-algo: "BCRYPT" }).then(function(data){ console.log(data); }); 

I believe that this is because the CLI syntax for auth import is not easily translatable to javascript like the other one word commands (list, logout, etc.). 我相信这是因为用于auth导入的CLI语法不像其他一个单词的命令(列表,注销等)那样容易地翻译成javascript。 I've tried looking at the documentation, but had no luck. 我曾尝试查看文档,但没有运气。

Does anyone have any idea how to go about this issue? 有谁知道如何解决这个问题? Here is a link to the git repo . 这是git repo的链接。

I was having trouble with this as well, and it took literally digging around in the library to try and find answers. 我也遇到了麻烦,它实际上是在图书馆中挖掘以尝试找到答案。 In the index.js file here you can see alias' for the listed bash commands. 这里index.js 文件中,您可以看到列出的bash命令的别名。 So for auth:import you should call client.auth.upload . 因此,对于auth:import ,应调用client.auth.upload However I have yet to find any documentation on the arguments you need to use for the node functions. 但是,我还没有找到有关需要用于节点函数的参数的任何文档。 I suspect they are buried in their corresponding alias here , but not even the deploy function there lists the arguments they use for it in the README. 我怀疑它们埋在这里相应别名中 ,但是那里的deploy函数甚至都没有列出它们在README中使用的参数。 If someone finds any documentation on using arguments, I'd love to know as well. 如果有人找到任何有关使用参数的文档,我也很想知道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM