有时,不会通过 Facebook 登录在 cognito 上创建用户

RHa*_*uck 5 amazon-cognito aws-amplify

在我的反应原生应用程序中,我为用户提供了使用 Facebook 按钮登录的可能性。为此,我使用 Amplify,它在 Cognito 中应该在用户池中创建一个用户。这也有效,但由于某种原因它并不总是有效。我也无法解释它,因为我不使用可能包含我的网站错误的触发器。大约 40% 的情况下无法登录。以下操作会导致错误:

  1. 用户点击 Facebook 按钮
  2. 用户将被转发到 Facebook
  3. 用户登录 Facebook
  4. 用户将被转发回反应本机应用程序。

结果:现在用户池中没有创建用户,并且react-native应用程序中出现以下错误(通过Hub.listen("auth")

{"event":"signIn_failure","data":{},"message":"The OAuth response flow failed"}
console.js:35
{"event":"signIn_failure","data":{},"message":"The OAuth response flow failed"}
console.js:35
{"event":"cognitoHostedUI_failure","data":{},"message":"A failure occurred when returning to the Cognito Hosted UI"}
console.js:35
{"event":"cognitoHostedUI_failure","data":{},"message":"A failure occurred when returning to the Cognito Hosted UI"}
console.js:35
{"event":"customState_failure","data":{},"message":"A failure occurred when returning state"}
console.js:35
{"event":"customState_failure","data":{},"message":"A failure occurred when returning state"}
Run Code Online (Sandbox Code Playgroud)

我的应用程序客户端设置如下所示:

应用程序客户端设置