Skip to content

Allow guest access example wrong variable #7899

Open
@jmarshall9120

Description

@jmarshall9120

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions