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

インポート

各画面には、それぞれ固有の Hooks とメソッドがあります。SDK は、各画面で部分インポートルートインポートをサポートしています。
  • 部分インポートを使用すると、特定のユースケースに必要なコードだけを含めることができます。
  • ルートインポートを使用すると、単一のバンドルからすべての画面を読み込めます。これは、想定されるあらゆる画面に対応する単一のビルドが必要な場合に便利です。
Import Example
// ルートインポート
import { useLoginEmailVerification } from '@auth0/auth0-acul-react';

// 部分インポート
import {
  useLoginEmailVerification,
  // コンテキストフック
  useUser,
  useTenant,
  useBranding,
  useClient,
  useOrganization,
  usePrompt,
  useScreen,
  useTransaction,
  useUntrustedData,
  // 共通フック
  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
このフックは、login-email-verification 画面に表示されるロゴ、色、テーマ設定などのブランディング構成を提供します。
Example
import { useBranding } from '@auth0/auth0-acul-react/login-email-verification';
function CustomTheme() {
  const branding = useBranding();
}
useClient
このフックは、login-email-verification 画面の idnamelogoUrl など、クライアント関連の構成を提供します。
Example
import { useClient } from '@auth0/auth0-acul-react/login-email-verification';
function AppInfo() {
  const client = useClient();
}
useOrganization
このフックは、ログインが組織スコープの場合に、ユーザーの組織に関する情報を提供します。組織コンテキストが存在しない場合は null を返します。
Example
import { useOrganization } from '@auth0/auth0-acul-react/login-email-verification';
function OrgSelector() {
  const organization = useOrganization();
  if (!organization) {
    return <p>No organization context</p>;
  }
}
usePrompt
このフックには、認証フローにおける現在のプロンプトに関するデータが含まれます。
Example
import { usePrompt } from '@auth0/auth0-acul-react/login-email-verification';
function FlowInfo() {
  const prompt = usePrompt();
}
useScreen
このフックには、設定やコンテキストを含む login-email-verification 画面固有の詳細が含まれます。
Example
import { useScreen } from '@auth0/auth0-acul-react/login-email-verification';
function ScreenDebug() {
  const screen = useScreen();
}
useTenant
このフックには、id や関連メタデータなど、テナントに関するデータが含まれます。
Example
import { useTenant } from '@auth0/auth0-acul-react/login-email-verification';
function TenantInfo() {
  const tenant = useTenant();
}
useTransaction
このフックは、アクティブな接続や現在のフロー状態など、login-email-verification 画面に関するトランザクション固有のデータを提供します。
Example
import { useTransaction } from '@auth0/auth0-acul-react/login-email-verification';
function TransactionInfo() {
  const transaction = useTransaction();
}
useUntrustedData
このフックは、URL クエリ文字列のパラメータなど、画面に渡される信頼できないデータを扱います。
Example
import { useUntrustedData } from '@auth0/auth0-acul-react/login-email-verification';
function PrefilledForm() {
  const untrustedData = useUntrustedData();
}
useUser
このフックは、アクティブなユーザーの詳細情報 (usernameemail、利用可能な認証方法など) を提供します。
Example
import { useUser } from '@auth0/auth0-acul-react/login-email-verification';
function UserProfile() {
  const user = useUser();
}
useLoginEmailVerification
このフックは、login-email-verification 画面で利用できるすべてのメソッドとコンテキストを返します。

メソッド

continueWithCode
Promise<void>
このメソッドは、メールアドレスの確認を続行するために、ユーザーが入力した確認コードを送信します。
Example
import { useLoginEmailVerification } from '@auth0/auth0-acul-react/login-email-verification';

function VerifyEmail() {
  const { continueWithCode } = useLoginEmailVerification();
  return (
    <button onClick={() => continueWithCode({ code: '123456' })}>
      Verify
    </button>
  );
}
メソッドパラメーター
resendCode
Promise<void>
このメソッドは、ユーザーのメールアドレスに新しい確認コードを送信するようリクエストします。
Example
import { useLoginEmailVerification } from '@auth0/auth0-acul-react/login-email-verification';

function ResendCode() {
  const { resendCode } = useLoginEmailVerification();
  return (
    <button onClick={() => resendCode()}>
      Resend Code
    </button>
  );
}
メソッドパラメーター

共通/ユーティリティ フック

このフックは、ブランディングコンテキストから、フラット化された設定を含む現在のテーマオプションを取得します。
このフックは、現在の ACUL 画面の表示言語を変更するための関数を返します。
このフックは、現在の画面のコンテキストと state を取得します。
このフックは、画面上のサーバー、クライアント、および開発者エラーを読み取り、管理します。
このフックは、code の再送アクションにおけるクールダウン状態と利用可否を管理します。