aws-amplify / aws-amplify/docs

Allow guest access example wrong variable

Open
#7,899 0 comments 0 reactions 0 assignees View on GitHub
amplify/js
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

![image](https://github.com/user-attachments/assets/bccfc7bf-6e6f-4b17-85d8-29bf107f7c54)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.