Meteor.js accounts-google 获取clientId和secret

Meteor.js accounts-google get clientId and secret

我在我的 meteor 应用程序中使用 accounts-google 包进行 oAuth。我想获取 clientId 和密码(显然存储在 meteor_accounts_loginServiceConfiguration mongo 集合中),但不确定如何操作。任何帮助都会很棒!谢谢。

您可以使用此代码段:

const googleServiceConfig = Accounts.loginServiceConfiguration.findOne({
  service: 'google',
});
console.log(googleServiceConfig.clientId, googleServiceConfig.secret);