Open ykethan opened 1 month ago
marking as a feature request
we could do something like
import { defineAuth } from "@aws-amplify/backend"
export const auth = defineAuth({
loginWith: {
email: true,
},
userAttributes: {
"custom:favorite_color": {
required: true,
},
},
})
The AWS CDK Congito user pool takes separate parameters for standardAttributes
and customAttributes
.
I think there are a few approaches that might be easier than allowing user attribute keys prefixed with custom:
custom
that is an object of user attributes. This is how the AttributeMapping interface in CDK does it for identity providersExample:
const userAttributes = {
email: {
required: true,
mutable: true,
},
custom: {
myCustomAttribute: {
required: false,
mutable: true,
},
},
}
customAttributes
that then gets passed directly to the CDK prop for custom attributes@josefaidt if you are open to either of these I can work on a PR.
Environment information
Description
Followup on issue: https://github.com/aws-amplify/amplify-backend/issues/1511
we currently need to modify the cfnUserPool schema to add a custom property on the backend. would be great if we could add this on defineAuth directly.