我正在尝试允许用户通过“登录facebook”注册我的服务。

我已经做了箭头1-2。我需要做箭头3-6。我在https://github.com/morenoh149/feathers-chat-facebook-signup-api上做了一个最小的Feathersjs示例
我似乎很难让feathers身份验证和passport-facebook-token生成用户对象并对其进行注册。我已经仔细检查过passport-facebook-token了。This answer解释说,在passport-facebook-token的回调中,您应该创建用户对象。我该如何用feathers authentication来做这件事?
当我在主体中提供令牌时
curl localhost:3030/authentication \
--data-binary '{\
"strategy": "facebook-token", \
"access_token": "<phone token>" \
}'我得到了
{"name":"NotAuthenticated",
"message":"You should provide access_token","code":401,
"className":"not-authenticated",
"data":{"message":"You should provide access_token"}当我将令牌作为标头传递时
curl localhost:3030/authentication \
-X POST \
-H "Authorization: Bearer <access token>"我得到了错误
{"name":"GeneralError",
"message":"Cannot read property 'toLowerCase' of undefined",
"code":500,"className":"general-error","data":{},"errors":{}}发布于 2019-02-05 23:35:14
所以我下载并运行了repo,我使用VSCode来运行应用程序并设置断点。我在创建用户之前的钩子中创建了一个断点。
这里的问题是,gravatar钩子预计电子邮件是context.data,但实际上它嵌入在facebook的响应中。您将需要考虑从该数据中提取电子邮件,以便您可以创建一个gravatar,或者完全删除gravatar钩子。
https://stackoverflow.com/questions/54469210
复制相似问题