一旦我为meteor应用程序设置了google登录配置,我如何重置它?

一旦我为meteor应用程序设置了google登录配置,我如何重置它?,meteor,Meteor,我正在学习meteor,并创建了一个新的应用程序,安装了accounts core、accounts google和accounts ui。这正如预期的那样工作,并促使我配置google集成。不过,在配置之后,我意识到我使用了错误的url,并在GoogleAPI中对其进行了更改。我如何使这一改变在流星方面生效?换句话说,我如何回到meteor google配置页面,在那里输入客户端id和密码?这个怎么样 仅清除帐户配置。我已在项目中尝试 正在清除项目中的所有数据 $ meteor reset

我正在学习meteor,并创建了一个新的应用程序,安装了accounts core、accounts google和accounts ui。这正如预期的那样工作,并促使我配置google集成。不过,在配置之后,我意识到我使用了错误的url,并在GoogleAPI中对其进行了更改。我如何使这一改变在流星方面生效?换句话说,我如何回到meteor google配置页面,在那里输入客户端id和密码?

这个怎么样

仅清除帐户配置。我已在项目中尝试

正在清除项目中的所有数据

$ meteor reset -h
Usage: meteor reset

Reset the current project to a fresh state. Removes all local
data and kills any running meteor development servers.

这只是snize回答中的一个轻微修改,但对我来说很有效:

$ meteor mongo
MongoDB shell version: 2.4.3
connecting to: 127.0.0.1:3002/meteor
> db.meteor_accounts_loginServiceConfiguration.remove({"service":"google"})

如果您需要在生产服务器上执行此操作,您没有
meteor
,但可以从shell运行
mongo
,那么过程非常类似:

$ mongo
...
Welcome to the MongoDB shell.
...
> show dbs
foo           0.078GB
bar           0.078GB
my_meteor_db  0.078GB
> use my_meteor_db
switched to my_meteor_db
> show collections
...
> db.meteor_accounts_loginServiceConfiguration.find()
...
> db.meteor_accounts_loginServiceConfiguration.remove({service:"google"})
WriteResult({ "nRemoved" : 1 })
> exit
bye
$

首先,添加服务配置包:

meteor add service-configuration
然后,在你的应用程序的系统文件夹中(如果你没有创建它),添加一个名为service.js的文件,并在其中添加:

//首先,如果服务已配置,请删除配置项
ServiceConfiguration.configurations.remove({
服务:“谷歌”
});
ServiceConfiguration.configurations.insert({
服务:“谷歌”,
客户ID:“123456789”,
登录样式:“弹出”,
秘密:“8j4ldfjSECRET-HEREalkjf8slk”
});
进一步阅读

流星重置将使一切恢复到0,明智地使用它。

似乎是一个“核选项”。有没有办法只刷新google api设置而不删除应用程序中的所有数据?您可能想使用
ServiceConfiguration.configurations.upsert
而不是delete/insert。对于已部署的项目,您还可以使用新的客户端id和secret编辑条目,而不是重置条目。
meteor add service-configuration