【发布时间】:2020-06-20 02:24:54
【问题描述】:
我正在尝试将 AWS 身份验证功能添加到应用程序。我已将配置添加到已经具有 graphql 和 pubsub 配置的文件中,我正在调用
App.js 中的Amplify.configure({ ...config.GraphQL, Auth: config.Auth })。
在尝试使用注册时,我在日志[NoUserPoolError: Authentication Error] 中收到以下错误。
验证码
import { Auth } from 'aws-amplify';
...
Auth.signUp({
username: email,
password,
attributes: {
email // optional
// other custom attributes
},
validationData: [] //optional
})
.then(data => console.log(data))
.catch(err => console.log('Error:Auth.signUp ', err));
我的配置如下
Auth: {
IdentityPoolId: 'xxxxxxxx',
identityPoolId: 'xxxxxxxx',
Region: 'xxxxxxxx',
region: 'xxxxxxxx',
RoleArn: 'xxxxxxxx',
UserPoolId: 'xxxxxxxx',
ClientId: 'xxxxxxxx'
},
GraphQL:{
//config for graphql
}
在应用程序中,我得到如下红屏。
我还没试过amplify push。
【问题讨论】:
标签: react-native amazon-cognito aws-amplify