> ## Documentation Index
> Fetch the complete documentation index at: https://translations.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# usePasswordValidation

```tsx theme={null}
usePasswordValidation(
  password: string,
  options?: { includeInErrors?: boolean },
): PasswordValidationResult
```

<ParamField body="usePasswordValidation" type={<span><a href="/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/PasswordValidationResult">PasswordValidationResult</a></span>}>
  この React フックは、現在の Auth0 パスワードポリシーに基づいてパスワードを検証し、
  パスワードが各ルールを満たしているかどうかを示す構造化された結果を返します。

  必要に応じて、検証結果をグローバルエラーマネージャーに送信できるため、
  フォームのエラーコンポーネントを自動的に更新できます。

  ### 主な機能

  * **ポリシー対応の検証** — テナントで設定されている Auth0 パスワードポリシーのルールに照らしてパスワードを検証します。
  * **エラーマネージャーとの統合** — 必要に応じて、検証失敗をフォームのエラーコンポーネントに自動的に反映します。

  ## パラメーター

  <ParamField body="password" type="string">
    検証するパスワード。
  </ParamField>

  <ParamField body="options" type="{ includeInErrors?: boolean }">
    フックのオプション設定。

    <Expandable title="プロパティ">
      <ParamField body="includeInErrors" type="boolean">
        `true` の場合、検証エラーはグローバルエラーマネージャーの `password` フィールドに保存されます。デフォルトは `false` です。
      </ParamField>
    </Expandable>
  </ParamField>

  ## 戻り値

  [`PasswordValidationResult`](/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/PasswordValidationResult)

  以下を含む [PasswordValidationResult](/ja/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/PasswordValidationResult) オブジェクト。

  * `isValid` — パスワードが設定されているすべてのルールを満たしている場合は `true`。
  * `results` — `code`、`label`、`status`、`isValid` を含む、ルールごとの結果の配列。

  ## サポートされている画面

  * `signup`
  * `signup-password`
  * `reset-password`

  ```tsx Example theme={null}
  import { usePasswordValidation } from '@auth0/auth0-acul-react/signup';

  const { isValid, results} = usePasswordValidation(password, { includeInErrors: true });

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

  ## 注記

  * `usePasswordValidation` はコンポーネントのトップレベルで呼び出してください。条件付きで呼び出したり、イベントハンドラー内で呼び出したりしないでください。
  * インポートパスは画面に対応している必要があります。適切な `signup`、`signup-password`、または `reset-password` を使用してください。
</ParamField>
