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

# LoginEmailVerification

> Universal Login の `login-email-verification` 画面をカスタマイズするために使用できる、すべてのフックとメソッドについて説明します。

`login-email-verification` 画面では、ログインフロー中の本人確認のために、メールアドレスに送信された確認コードを入力するようユーザーに求めます。

![ログイン時のメール確認](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/2kIZmIlrAHoSTyaD8thnIL/515c6f940036953d2989c7b37b7f1fe2/Screenshot_2025-05-15_at_21.18.53.png)

## インポート

各画面には、それぞれ固有のフックとメソッドがあります。SDK は各画面で **部分インポート** と **ルートインポート** をサポートしています。

* 部分インポートを使うと、特定のユースケースに必要なコードだけを含められます。
* ルートインポートを使うと、1 つのバンドルからすべての画面を読み込めるため、想定されるあらゆる画面に対応する統一ビルドが必要な場合に便利です。

```jsx Import Example theme={null}
// ルートインポート
import { useLoginEmailVerification } from '@auth0/auth0-acul-react';

// 部分インポート
import {
  useLoginEmailVerification,
  // コンテキストフック
  useUser,
  useTenant,
  useBranding,
  useClient,
  useOrganization,
  usePrompt,
  useScreen,
  useTransaction,
  useUntrustedData,
  useExperiment,
  // 共通フック
  useCurrentScreen,
  useAuth0Themes,
  useErrors,
  // ユーティリティフック
  useChangeLanguage,
  useResend,
  // メソッド
  continueWithCode,
  resendCode,
} from '@auth0/auth0-acul-react/login-email-verification';

function LoginEmailVerificationForm() {
  const { continueWithCode } = useLoginEmailVerification();
  return (
    <button onClick={() => continueWithCode({ code: '123456' })}>
      Verify
    </button>
  );
}
```

## コンテキストフック

`login-email-verification` 画面で、Auth0 のコンテキストデータに読み取り専用でアクセスできる画面スコープのフックです。`@auth0/auth0-acul-react/login-email-verification` からインポートします。

**useBranding** `() => [BrandingMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/BrandingMembers)`

このフックは、`login-email-verification` 画面に表示されるロゴ、色、テーマ設定などのブランディング設定を提供します。

```jsx Example theme={null}
import { useBranding } from '@auth0/auth0-acul-react/login-email-verification';
function CustomTheme() {
  const branding = useBranding();
}
```

**useClient** `() => [ClientMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ClientMembers)`

このフックは、`login-email-verification` 画面の `id`、`name`、`logoUrl` など、クライアント関連の設定を提供します。

```jsx Example theme={null}
import { useClient } from '@auth0/auth0-acul-react/login-email-verification';
function AppInfo() {
  const client = useClient();
}
```

**useExperiment** `() => [ExperimentMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ExperimentMembers)`

このフックは、`login-email-verification` 画面で現在有効な [Experiment Center](/docs/docs/ja-jp/customize/experiment-center) の experiment を提供します。有効な experiment がない場合 (または画面が `context_configuration` でオプトインしていない場合) は `null` を返します。

```jsx Example theme={null}
import { useExperiment } from '@auth0/auth0-acul-react/login-email-verification';
function ExperimentBranch() {
  const experiment = useExperiment();
  if (!experiment) return null;
  return experiment.isControl ? <ControlUI /> : <TreatmentUI />;
}
```

**useOrganization** `() => [OrganizationMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/OrganizationMembers)`

このフックは、ログインが組織スコープの場合に、ユーザーの組織に関する情報を提供します。組織コンテキストが存在しない場合は `null` を返します。

```jsx Example theme={null}
import { useOrganization } from '@auth0/auth0-acul-react/login-email-verification';
function OrgSelector() {
  const organization = useOrganization();
  if (!organization) {
    return <p>No organization context</p>;
  }
}
```

**usePrompt** `() => [PromptMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/PromptMembers)`

このフックには、認証フロー内の現在の prompt に関するデータが含まれます。

```jsx Example theme={null}
import { usePrompt } from '@auth0/auth0-acul-react/login-email-verification';
function FlowInfo() {
  const prompt = usePrompt();
}
```

**useScreen** `() => [ScreenMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ScreenMembers)`

このフックには、設定やコンテキストなど、`login-email-verification` 画面に固有の詳細が含まれます。

```jsx Example theme={null}
import { useScreen } from '@auth0/auth0-acul-react/login-email-verification';
function ScreenDebug() {
  const screen = useScreen();
}
```

**useTenant** `() => [TenantMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/TenantMembers)`

このフックには、`id` や関連するメタデータなど、テナントに関連するデータが含まれます。

```jsx Example theme={null}
import { useTenant } from '@auth0/auth0-acul-react/login-email-verification';
function TenantInfo() {
  const tenant = useTenant();
}
```

**useTransaction** `() => [TransactionMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/TransactionMembers)`

このフックは、`login-email-verification` 画面における、アクティブな接続や現在のフローの状態など、トランザクション固有のデータを提供します。

```jsx Example theme={null}
import { useTransaction } from '@auth0/auth0-acul-react/login-email-verification';
function TransactionInfo() {
  const transaction = useTransaction();
}
```

**useUntrustedData** `() => [UntrustedDataMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UntrustedDataMembers)`

このフックは、URL のクエリ文字列に含まれるパラメーターなど、画面に渡される信頼されていないデータを処理します。

```jsx Example theme={null}
import { useUntrustedData } from '@auth0/auth0-acul-react/login-email-verification';
function PrefilledForm() {
  const untrustedData = useUntrustedData();
}
```

**useUser** `() => [UserMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UserMembers)`

このフックは、`username`、`email`、利用可能な認証方法など、現在アクティブなユーザーの詳細情報を提供します。

```jsx Example theme={null}
import { useUser } from '@auth0/auth0-acul-react/login-email-verification';
function UserProfile() {
  const user = useUser();
}
```

**useLoginEmailVerification** `[LoginEmailVerificationMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/LoginEmailVerificationMembers)`

このフックは、`login-email-verification` 画面で利用できるすべてのメソッドとコンテキストを返します。

## メソッド

**continueWithCode** `Promise\<void\>`

このメソッドは、ユーザーが入力した確認コードを送信し、メールアドレスの確認を進めます。

```jsx Example theme={null}
import { useLoginEmailVerification } from '@auth0/auth0-acul-react/login-email-verification';

function VerifyEmail() {
  const { continueWithCode } = useLoginEmailVerification();
  return (
    <button onClick={() => continueWithCode({ code: '123456' })}>
      Verify
    </button>
  );
}
```

**メソッドのパラメーター**

**パラメーター**

**options**

[ContinueWithCodeOptionPayload](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ContinueWithCodeOptionPayload)。

**code** `string` *required*

ユーザーのメールアドレスに送信された確認コード。

**resendCode** `Promise\<void\>`

ユーザーのメールアドレス宛てに新しい確認コードをリクエストします。

このメソッドはAuth0にフォームを送信します。Auth0がこのスクリーンを再度レンダリングするため、ブラウザーでページが再読み込みされ、Reactの状態、エフェクト、タイマーは失われます。

`resendCode()` を呼び出す際は、次の点に注意してください。

* `await resendCode()` の後に実行されるコードで設定した状態 (「コードを送信しました」というメッセージやカウントダウンなど) は保持されないため、それに依存することはできません。
* レート制限などのサーバー側のエラーは、ページの再読み込み後に `useErrors()` に表示されます。これらのエラーによって、返されたPromiseがrejectされることはありません。
* 返されたPromiseは、フォームが送信された時点 (ページの再読み込み前) でresolveします。このPromiseは、Auth0が新しいコードを送信したことを保証するものではありません。

再送信の間にクールダウンを設けるには、`useResend()` を使用します。`useResend()` Hooksはカウントダウンを `localStorage` に保存するため、ページを再読み込みしてもカウントダウンは維持されます。

```jsx Example theme={null}
import { useLoginEmailVerification } from '@auth0/auth0-acul-react/login-email-verification';

function ResendCode() {
  const { resendCode } = useLoginEmailVerification();
  return (
    <button onClick={() => resendCode()}>
      Resend Code
    </button>
  );
}
```

## 共通/ユーティリティHooks

**[useAuth0Themes](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useAuth0Themes)** `Hooks`

このHooksは、ブランディングコンテキストから、フラット化された設定を含む現在のテーマオプションを取得します。

**[useChangeLanguage](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useChangeLanguage)** `Hooks`

このHooksは、現在の ACUL スクリーンの表示言語を変更するための関数を返します。

**[useCurrentScreen](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useCurrentScreen)** `Hooks`

このHooksは、現在のスクリーンのコンテキストと状態を取得します。

**[useErrors](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useErrors)** `Hooks`

このHooksは、スクリーン上のサーバーエラー、クライアントエラー、開発者向けエラーを読み取り、管理します。

**[useResend](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useResend)** `Hooks`

このスクリーンの再送クールダウンを管理します。このHooksは、残り秒数、再送が無効かどうか、そして再送を実行してクールダウンのカウントを開始する `startResend()` 関数を返します。再送に伴ってページが再読み込みされても、カウントダウンは引き継がれます。
