aws-amplify / aws-amplify/docs
Allow guest access example wrong variable
- Dominant language
- MDX
- Stars
- 506
- Forks
- 1.1k
- Avg merge
- 3h 14m
- Merged PRs (30d)
- 1
Description
This Code is in the example:
```
import { Amplify } from "aws-amplify";
import outputs from "../amplify_outputs.json";
Amplify.configure(
{
...outputs,
Auth: {
Cognito: {
identityPoolId: config.aws_cognito_identity_pool_id,
userPoolClientId: config.aws_user_pools_web_client_id,
userPoolId: config.aws_user_pools_id,
allowGuestAccess: true,
},
},
}
);
```
Config is not not defined. I believe you want this:
```
import { Amplify } from "aws-amplify";
import outputs from "../amplify_outputs.json";
Amplify.configure(
{
...outputs,
Auth: {
Cognito: {
identityPoolId: outputs.auth.identity_pool_id,
userPoolClientId: outputs.auth.user_pool_client_id,
userPoolId: outputs.auth.user_pool_id,
allowGuestAccess: true,
},
},
}
);
```
Using some config here would also overwrite the output, and defeat the auto generation purpose.
**URL page where content issue is**:
https://docs.amplify.aws/javascript/build-a-backend/data/customize-authz/public-data-access/#add-public-authorization-rule-using-amazon-cognito-identity-pools-unauthenticated-role

Contributor guide
Assessment
This issue has not been assessed yet.