繁体   English   中英

添加Meteor登录google oauth

[英]Add Meteor login google oauth

我正在尝试使用google oauth为Meteor中的按钮创建一个简单的登录按钮。 我执行了以下命令

mrt create accounts mrt add accounts-google mrt add accounts-ui

我掏空了默认的html / css / js并添加了:client / index.html server / config.js

这是config.js

Accounts.loginServiceConfiguration.remove({
   service: "google"
});
Accounts.loginServiceConfiguration.insert({
    service: "google",
    clientId: "[redacted]",
    secret: "[redacted]"
})

这是index.html

<head>
    <title>Accounts</title>
</head>

<body>
    {{loginButtons}}
    {{#if currentUser}}
        {{currentUser.profile.login}}
    {{/if}}
</body>

但是,使用配置我尝试启动服务器时出现以下错误:W20140729-22:22:42.461(-5)? (STDERR)W20140729-22:22:42.844(-5)? (STDERR)/home/tim/.meteor/tools/cef2bcd356/lib/node_modules/fibers/future.js:173 W20140729-22:22:42.845(-5)? (STDERR)throw(ex); W20140729-22:22:42.845(-5)? (STDERR)^ W20140729-22:22:42.846(-5)? (STDERR)TypeError:无法调用未定义的方法'remove'W20140729-22:22:42.846(-5)? (STDERR)在app / server / config.js:1:71 W20140729-22:22:42.847(-5)? (STDERR)在app / server / config.js:11:3 W20140729-22:22:42.847(-5)? (STDERR)/home/tim/Desktop/accounts/.meteor/local/build/programs/server/boot.js:161:10 W20140729-22:22:42.849(-5)? (STDERR)在Array.forEach(native)W20140729-22:22:42.850(-5)? (STDERR)在函数。 。每。 .forEach(/home/tim/.meteor/tools/cef2bcd356/lib/node_modules/underscore/underscore.js:79:11)W20140729-22:22:42.851(-5)? (STDERR)/home/tim/Desktop/accounts/.meteor/local/build/programs/server/boot.js:82:5 =>退出代码:8

配置来自一个旧教程,所以我想知道代码是否过时,但我找不到更新的东西。 有谁知道发生了什么事?

您需要做的就是使用以下命令添加service-configuration包:

meteor add service-configuration

干杯!

暂无
暂无

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

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