When defining the auth/resource.ts, adding custom: attributes to the userAttributes doesn't work and causes an error. #2111
Labels
auth
Issue pertaining to Amplify Auth
pending-response
Issue is pending response from author
pending-triage
Incoming issues that need categorization
Environment information
Describe the bug
Adding custom attributes to the userAttributes section of amplify/auth/resource.ts causes an error. If a standard userAttribute is included in the userAttributes then the error is not picked up by JetBrains Rider, but the Build will fail with an error such as
amplify/auth/resource.ts(18,5): error TS2353: Object literal may only specify known properties, and '"custom:company"' does not exist in type 'StandardAttributes'.
If the userAttributes section only contains custom attributes, such as in the Custom attributes script from https://docs.amplify.aws/nextjs/build-a-backend/auth/concepts/user-attributes/ , then Rider will immediately pick up the error:
Argument type {userAttributes: {"custom:favorite_number": {min: number, max: number, dataType: string, mutable: boolean}, "custom:is_beta_user": {dataType: string, mutable: boolean}, "custom:display_name": {dataType: string, mutable: boolean, minLen: number, maxLen: number}, "custom:started_free_trial": {dataType: string, mutable: boolean}}, loginWith: {email: {verificationEmailSubject: string}}} is not assignable to parameter type AmplifyAuthProps
Has there been an undocumented change to how customAttributes are added when defining the auth?
Reproduction steps
The easiest way to reproduce this bug is to follow the instructions for creating custom attributes on https://docs.amplify.aws/nextjs/build-a-backend/auth/concepts/user-attributes/
The text was updated successfully, but these errors were encountered: