tafalk / tafalk-web

A no-look-back site for streams of consciousness to be grown by Woolfies
https://tafalk.com
MIT License
1 stars 0 forks source link

Guest (Unauthenticated) users cannot make API.graphql() calls #81

Closed vahdet closed 4 years ago

vahdet commented 4 years ago

An error is shown as notistack snackbar:

"No current user"

and the content does not show up. The issue is probably not in the AuthContext, but with Appsync Unauthenticated access like: https://github.com/aws-amplify/amplify-js/issues/2967#issuecomment-479268740

This issue comment proposes altering authentication type on login/logout: https://github.com/aws-amplify/amplify-js/issues/1252#issuecomment-634521518

Asked a question on SO: https://stackoverflow.com/q/63248083/4636715

A TODO comment added with dbb8697496110ffb5594c8aab67b8f4858cc796e

vahdet commented 4 years ago

Amazon Cognito User Pools is defined pretty much like an only-auth option. So, this issue may not be a bug but feature. https://aws.amazon.com/blogs/mobile/graphql-security-appsync-amplify/

vahdet commented 4 years ago

With 51bb1ed0709b012e292c78bbb9f0c690c59efb19 added an AuthContext for switching between AWS_IAM and AWS_COGNITO_USER_POOLS depending on the existence of an authenticated user visit.