我正在使用Parse Server 3.0.0,并试图使其与Facebook的Account Kit一起使用。我已按照文档中的说明进行了以下操作:
var polaris = new ParseServer({
databaseURI: 'mongodb://localhost:27017/polaris',
cloud: __dirname + '/cloud/main.js',
appId: 'polarisAppId',
masterKey: 'polarisMasterKey',
serverURL: 'http://' + ipAddress + ':1337/polaris',
auth: {
facebookaccountkit: {
appIds: ["app_id_here"],
appSecret: "app_secret_here"
},
}
});
let accountKitAuthData = {
"id": accountKitId,
"access_token": accessToken,
"last_refresh": lastRefresh
}
let user = new Parse.User()
user._linkWith('facebookaccountkit', accountKitAuthData).then(function (user) {
console.log("linkWith method finished ")
console.log("user object type " + (typeof user))
});
但是,毕竟,我得到了以下错误:
(node:21807) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'authenticate' of undefined`
我最好的猜测是 facebookaccountkit 提供程序由于某种原因未注册,但我可能是错的。请帮忙!
使用facebookaccountkit凭据链接用户
错误:
(node:21807) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'authenticate' of undefined`
答案 0 :(得分:0)
使用此:
let accountKitAuthData = {
"id": accountKitId,
"access_token": accessToken,
"last_refresh": lastRefresh
}
let user = new Parse.User()
user._linkWith('facebookaccountkit', { authData: accountKitAuthData }).then(function (user) {
console.log("linkWith method finished ")
console.log("user object type " + (typeof user))
});