如果我不提供amplifyConfig道具,它将正常渲染(当然它不能实际登录/注册)。
但是,如果我放amplifyConfig属性,只会显示Loading...。
隐藏加载组件时,它什么也没显示。
我仅使用默认的auth配置配置了社交提供程序,即使没有联合道具也是如此。
如何使Authenticator组件正常工作?我想搜索一个关键字。
My code is roughly like this
function App ({ authState }) {
return (
authState === 'signedIn' ? (
<div>
{something}
</div>
) : <div />
)
}
const federated = {
google_client_id: '86070459099-1fl345l9jddl8kpuemv08kpsic3jrha2.apps.googleusercontent.com',
facebook_app_id: '1173021809562416',
amazon_client_id: ''
}
class AppWithAuth extends Component {
render () {
return (
<Authenticator
amplifyConfig={awsconfig}
>
<App />
</Authenticator>
)
}
}
// export default withAuthenticator(FullWindow, true, [], federated, {})
// export default FullWindow
export default AppWithAuth
my awsconfig
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
const awsmobile = {
"aws_project_region": "us-east-1",
"aws_cognito_identity_pool_id": "us-east-1:5c6a10e4-b89e-4733-bdeb-20b257bbf7fd",
"aws_cognito_region": "us-east-1",
"aws_user_pools_id": "us-east-1_n0MOhpx2p",
"aws_user_pools_web_client_id": "4dub9op9hjj61c6u64j0g6n790",
"oauth": {
"domain": "learnobit69bcc274-69bcc274-master.auth.us-east-1.amazoncognito.com",
"scope": [
"phone",
"email",
"openid",
"profile",
"aws.cognito.signin.user.admin"
],
"redirectSignIn": "http://localhost:5000/",
"redirectSignOut": "http://localhost:5000/",
"responseType": "code"
},
"federationTarget": "COGNITO_USER_POOLS"
};
export default awsmobile;