I am using Parse Server 3.0.0 and trying to get it to work with Facebook's Account Kit. I have followed the instructions in the docs and done the following:
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))
});
However, after all this, I am getting the following error:
(node:21807) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'authenticate' of undefined`
My best guess is that the facebookaccountkit provider is not getting registered due to some reason but I may be wrong. Please help!
Linking of user with facebookaccountkit credentials
Error:
(node:21807) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'authenticate' of undefined`
Use this:
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))
});