@auth0/auth0-acul-react - v1.0.0
    Preparing search index...

    Function usePasswordValidation

    • This React hook validates a password against the current Auth0 password policy and returns a structured result describing whether the password satisfies each rule.

      Optionally, it can send the validation results to the global error manager so that form error components can update automatically.

      Parameters

      • password: string

        The password to validate.

      • Optionaloptions: { includeInErrors?: boolean }
        • OptionalincludeInErrors?: boolean

          If true, validation errors are stored in the global error manager under the password field. Defaults to false.

      Returns PasswordValidationResult

      A PasswordValidationResult object containing:

      • isValidtrue if the password satisfies all configured rules.
      • results — an array of per-rule results with code, label, status, and isValid.
      • signup
      • signup-password
      • reset-password
         import { usePasswordValidation } from '@auth0/auth0-acul-react/signup';
      const { isValid, results} = usePasswordValidation(password, { includeInErrors: true });

      if (!isValid) {
      console.log(results);
      }