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

FR (Authenticator) Custom password validators for authenticator

Open venkatsainath opened this issue 1 year ago • 2 comments

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

venkatsainath avatar Aug 25 '23 07:08 venkatsainath

@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?

ioanabrooks avatar Aug 29 '23 16:08 ioanabrooks

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.

tswacast avatar Feb 02 '24 19:02 tswacast