React Native Firebase
    Preparing search index...
    • Validates the password against the password policy configured for the project or tenant.

      Parameters

      Returns Promise<PasswordValidationStatus>

    • Validates the password against the password policy configured for the project or tenant.

      Parameters

      Returns Promise<PasswordValidationStatus>

      If no tenant ID is set on the Auth instance, then this method will use the password policy configured for the project. Otherwise, this method will use the policy configured for the tenant. If a password policy has not been configured, then the default policy configured for all projects will be used.

      If an auth flow fails because a submitted password does not meet the password policy requirements and this method has previously been called, then this method will use the most recent policy available when called again.

      When using this method, ensure you have the Identity Toolkit enabled on the Google Cloud Platform with the API Key for your application permitted to use it.

      import { getAuth, validatePassword } from "firebase/auth";

      const status = await validatePassword(getAuth(), passwordFromUser);
      if (!status.isValid) {
      // Password could not be validated. Use the status to show what
      // requirements are met and which are missing.

      // If a criterion is undefined, it is not required by policy. If the
      // criterion is defined but false, it is required but not fulfilled by
      // the given password. For example:
      const needsLowerCase = status.containsLowercaseLetter !== true;
      }