amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

Enable 'Prevent User Existence Error" on User Pools by Default

Open haverchuck opened this issue 2 years ago • 1 comments

Is this feature request related to a new or existing Amplify category?

auth

Is this related to another service?

No

Describe the feature you'd like to request

When a new User Pool is created with the Amplify CLI, it should set the "Prevent User Existence Errors" flag on the User Pool App Clients to "true" by default.

Describe the solution you'd like

Enable the setting by default.

Describe alternatives you've considered

N/A

Additional context

Requested by customer in Amplify Flutter repository issue: https://github.com/aws-amplify/amplify-flutter/issues/4170#issuecomment-1831533628

Is this something that you'd be interested in working on?

  • [ ] 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • [X] ⚠️ This feature might incur a breaking change

haverchuck avatar Dec 01 '23 19:12 haverchuck

Hey @haverchuck, thank you for reaching out. Marking as feature request.

As a workaround we can enable this by running amplify override auth, then add the following and push.

import {
  AmplifyAuthCognitoStackTemplate,
  AmplifyProjectInfo,
} from "@aws-amplify/cli-extensibility-helper";

export function override(
  resources: AmplifyAuthCognitoStackTemplate,
  amplifyProjectInfo: AmplifyProjectInfo
) {
  resources.userPoolClient.preventUserExistenceErrors = "ENABLED";
}

output: image

ykethan avatar Dec 01 '23 19:12 ykethan