aws-amplify / amplify-ui

Amplify UI is a collection of accessible, themeable, performant React (and more!) components that can connect directly to the cloud.
https://ui.docs.amplify.aws
Apache License 2.0
792 stars 262 forks source link

FR (Authenticator) Custom password validators for authenticator #4383

Open venkatsainath opened 11 months ago

venkatsainath commented 11 months ago

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

React

Which UI component?

Authenticator

How is your app built?

react with nextjs

What browsers are you seeing the problem on?

Chrome, Firefox

Which region are you seeing the problem in?

india

Please describe your bug.

i am unble to add weak password validation for authenticator using react-ui , tried searching in the documents to

What's the expected behaviour?

I want a weak password message when i am reseting my password in authenticator

Help us reproduce the bug!

got to login form using authenticator of react click on reset password then click ok send link now when entering the new password the validation is not happening

Code Snippet


// Put your code below this line.

const formFields = {
  signIn: {
    username: {
      placeholder: 'Enter your emails',
    },
  },
  signUp: {
    password: {
      label: 'Password:',
      placeholder: 'Enter your asPassword:',
      isRequired: true,
      order: 2,
    },
    confirm_password: {
      label: 'Confirm Password:',
      order: 2,
    },
  },
  resetPassword: {
    username: {
      placeholder: 'Enter your email:',
    },
  },
  confirmResetPassword: {
    confirmation_code: {
      placeholder: 'Enter your Confirmation Code',
      label: 'Enter Code',
      isRequired: true,
      hide:true
    },
    password: {
      label: 'Password:',
      placeholder: 'Enter your asPassword:',
      isRequired: true,
    },
    confirm_password: {
      placeholder: 'Confirm Password',
      label: 'Confirm Password:',
      isRequired:true,
    },
  },
  setupTOTP: {
    QR: {
      totpIssuer: 'test issuer',
      totpUsername: 'amplify_qr_test_user',
    },
    confirmation_code: {
      label: 'New Label',
      placeholder: 'Enter your Confirmation Code:',
      isRequired: false,
    },
  },
  confirmSignIn: {
    confirmation_code: {
      label: 'New Label',
      placeholder: 'Enter your Confirmation Code:',
      isRequired: false,
    },
  },
};

<Authenticator
      formFields={formFields}
        socialProviders={[]}
        hideSignUp
      >

      </Authenticator>

### Console log output

_No response_

### Additional information and screenshots

import { Authenticator } from "@aws-amplify/ui-react";

using the above import
ioanabrooks commented 11 months ago

@venkatsainath reclassified this issue as a feature request, as custom password validators are not currently supported for the Reset Password component. Could you please confirm that this is the ask?

tswacast commented 5 months ago

I would like to second this request. We have the need to include a password strength meter and validation feedback to the user as they change their password in both the ConfirmNewPassword and the ForceNewPassword and workflows.