aws-amplify

How to properly handle unauthenticated users and requests in AWS Amplify/AppSync React apps?

六眼飞鱼酱① 提交于 2020-12-01 13:24:03
问题 I am having a very hard time to figure out how to handle unauthenticated users in a React app which uses AWS Amplify and AWS AppSync. Seems like most docs suggest to wrap the whole app with withAuthenticator HOC from aws-amplify-react but in the real world it is a very rare case. So here how I am setting a client to talk to the AppSync API const client = new AWSAppSyncClient({ url: AppSyncConfig.aws_appsync_graphqlEndpoint, region: AppSyncConfig.aws_appsync_region, auth: { type: AUTH_TYPE