Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

userAttributes "fullname" doesn't show up in amplify_outputs.json #1472

Closed
Zhuohui-Li opened this issue May 8, 2024 · 3 comments · Fixed by #1519
Closed

userAttributes "fullname" doesn't show up in amplify_outputs.json #1472

Zhuohui-Li opened this issue May 8, 2024 · 3 comments · Fixed by #1519
Labels
auth Issue pertaining to Amplify Auth bug Something isn't working p2

Comments

@Zhuohui-Li
Copy link

Zhuohui-Li commented May 8, 2024

Environment information

System:
  OS: macOS 14.4
  CPU: (10) arm64 Apple M1 Pro
  Memory: 145.38 MB / 16.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 20.12.2 - /private/var/folders/h8/0sklzj9n1pz2zjt34vl3t15w0000gn/T/xfs-67f2acff/node
  Yarn: 4.1.1 - /private/var/folders/h8/0sklzj9n1pz2zjt34vl3t15w0000gn/T/xfs-67f2acff/yarn
  npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/backend: 1.0.0
  @aws-amplify/backend-cli: 1.0.1
  aws-amplify: 6.2.0
  aws-cdk: 2.139.0
  aws-cdk-lib: 2.139.0
  typescript: 5.4.5
AWS environment variables:
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables

Description

export const auth = defineAuth({
  loginWith: {
    email: true,
  },
  userAttributes: {
    fullname: { required: true },
    givenName: { required: true },
    familyName: {},
    email: { required: true, mutable: false },
  },

amplify_outputs.json

{
  "auth": {
    "user_pool_id": "",
    "aws_region": "",
    "user_pool_client_id": "",
    "identity_pool_id": "",
    "standard_required_attributes": [
      "email",
      "given_name" // should have full_name or name
    ],
    "username_attributes": [
      "email"
    ],
    "user_verification_types": [
      "email"
    ],
    "password_policy": {
      "min_length": 8,
      "require_numbers": true,
      "require_lowercase": true,
      "require_uppercase": true,
      "require_symbols": true
    },
    "unauthenticated_identities_enabled": true
  },

Attributes did not conform to the schema: name.formatted: The attribute name.formatted is required
image

@Zhuohui-Li Zhuohui-Li added the pending-triage Incoming issues that need categorization label May 8, 2024
@ykethan
Copy link
Contributor

ykethan commented May 9, 2024

Hey, thank you for reaching. Was able to reproduce the behavior. Marking as bug.

Note: Cogntio attribute mapping on CDK lib: https://github.com/aws/aws-cdk/blob/v2.140.0/packages/aws-cdk-lib/aws-cognito/lib/private/attr-names.ts#L10

@ykethan ykethan added bug Something isn't working auth Issue pertaining to Amplify Auth and removed pending-triage Incoming issues that need categorization labels May 9, 2024
@zchenwei
Copy link

zchenwei commented May 9, 2024

I think timezone is also missing other than fullname

export const auth = defineAuth({
  loginWith: {
    email: true,
  },
  userAttributes: {
    preferredUsername: {
      mutable: true,
      required: true,
    },
    address: {
      mutable: true,
      required: true,
    },
    birthdate: {
      mutable: true,
      required: true,
    },
    gender: {
      mutable: true,
      required: true,
    },
    givenName: {
      mutable: true,
      required: true,
    },
    familyName: {
      mutable: true,
      required: true,
    },
    locale: {
      mutable: true,
      required: true,
    },
    middleName: {
      mutable: true,
      required: true,
    },
    fullname: {
      mutable: true,
      required: true,
    },
    nickname: {
      mutable: true,
      required: true,
    },
    phoneNumber: {
      mutable: true,
      required: true,
    },
    profilePicture: {
      mutable: true,
      required: true,
    },
    profilePage: {
      mutable: true,
      required: true,
    },
    website: {
      mutable: true,
      required: true,
    },
    timezone: {
      mutable: true,
      required: true,
    },
    lastUpdateTime: {
      mutable: true,
      required: true,
    },
  },
});

amplify_outputs.json

"standard_required_attributes": [
  "email",
  "phone_number",
  "preferred_username",
  "address",
  "birthdate",
  "gender",
  "given_name",
  "family_name",
  "locale",
  "middle_name",
  "nickname",
  "picture",
  "profile",
  "website",
  "updated_at"
  // should have "zoneinfo" and "name"
]

@Zhuohui-Li
Copy link
Author

export default withAuthenticator(App, {
  signUpAttributes: ["name"],
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issue pertaining to Amplify Auth bug Something isn't working p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants