Ошибка вызова updateUserAttributes в AWS Amplify - PullRequest
0 голосов
/ 13 марта 2019

При вызове updateUserAttributes в Amplify я получаю следующие ошибки:

2019-03-13 08:31:18.937 25019-25057 E/ReactNativeJS: undefined is not a function (evaluating 'Object.keys(styles)[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"]()')
2019-03-13 08:31:18.942 25019-25057 E/ReactNativeJS: undefined is not a function (evaluating '_$$_REQUIRE(_dependencyMap[2], "pretty-format")(error)')

Код вызова выглядит следующим образом:

const user = await getCurrentAuthenticatedUser();
Auth.updateUserAttributes(user, { 'custom:token': token } ).then(result =>{ console.log(result)});

getCurrentAuthenticatedUser оборачивает функцию Auth.currentAuthenticatedUser и возвращаетпользователь от Cognito.

Версия с усилением: 1.1.22

1 Ответ

0 голосов
/ 13 марта 2019

Проблема решена.

Добавление .catch к вызову функции устраняет ошибку:

Auth.updateUserAttributes(user, { 'custom:token': token } )
    .then(result =>{ console.log(result)})
    .catch(err => console.log(err));
...