メインコンテンツへスキップ
mfa-recovery-code-challenge-new-code 画面では、認証が正常に完了すると、新しいリカバリーコードがユーザーに表示され、安全な場所に保存するよう求められます。
MfaRecoveryCodeChallengeNewCode

インポート

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

// 部分インポート
import {
  useMfaRecoveryCodeChallengeNewCode,
  // コンテキストHooks
  useUser,
  useTenant,
  useBranding,
  useClient,
  useOrganization,
  usePrompt,
  useScreen,
  useTransaction,
  useUntrustedData,
  // 共通Hooks
  useCurrentScreen,
  useAuth0Themes,
  useErrors,
  // ユーティリティHooks
  useChangeLanguage,
  // メソッド
  continueMethod,
} from "@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code";

function MfaRecoveryCodeChallengeNewCodeScreen() {
  const { continueMethod } = useMfaRecoveryCodeChallengeNewCode();
  return (
    <button onClick={() => continueMethod()}>
      I've Saved My Code
    </button>
  );
}

コンテキストHooks

mfa-recovery-code-challenge-new-code 画面で、Auth0 のコンテキストデータへの読み取り専用アクセスを提供する画面スコープのHooksです。@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code からインポートします。
useBranding
このHooksは、mfa-recovery-code-challenge-new-code 画面に表示されるロゴ、色、テーマ設定などのブランディング設定を提供します。
Example
import { useBranding } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function CustomTheme() {
  const branding = useBranding();
}
useClient
このHooksは、mfa-recovery-code-challenge-new-code 画面の idnamelogoUrl などのクライアント関連の設定を提供します。
Example
import { useClient } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function AppInfo() {
  const client = useClient();
}
useOrganization
このHooksは、MFA フローが組織スコープの場合に、ユーザーの組織に関する情報を提供します。組織コンテキストが存在しない場合は null を返します。
Example
import { useOrganization } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function OrgSelector() {
  const organization = useOrganization();
  if (!organization) {
    return <p>No organization context</p>;
  }
}
usePrompt
このHooksには、認証フロー内の現在のプロンプトに関するデータが含まれます。
Example
import { usePrompt } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function FlowInfo() {
  const prompt = usePrompt();
}
このHooksには、mfa-recovery-code-challenge-new-code 画面固有の詳細 (設定やコンテキストなど) が含まれます。
Example
import { useScreen } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function ScreenDebug() {
  const screen = useScreen();
}
useTenant
このHooksには、id や関連するメタデータなど、テナントに関するデータが含まれます。
Example
import { useTenant } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function TenantInfo() {
  const tenant = useTenant();
}
useTransaction
このHooksは、現在の MFA フローの状態など、mfa-recovery-code-challenge-new-code 画面のトランザクション固有データを提供します。
Example
import { useTransaction } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function TransactionInfo() {
  const transaction = useTransaction();
}
useUntrustedData
このHooksは、URL パラメーターから事前入力された値など、画面に渡される信頼できないデータを扱います。
Example
import { useUntrustedData } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function PrefilledForm() {
  const untrustedData = useUntrustedData();
}
useUser
このHooksは、usernameemail、利用可能な認証方法など、現在アクティブなユーザーの詳細を提供します。
Example
import { useUser } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function UserProfile() {
  const user = useUser();
}
useMfaRecoveryCodeChallengeNewCode
このHooksは、mfa-recovery-code-challenge-new-code 画面で利用できるすべてのメソッドとコンテキストを返します。

メソッド

continueMethod
Promise<void>
このメソッドは、ユーザーが新しいリカバリーコードを保存済みであることを確認し、認証フローを続行します。
Example
import { useMfaRecoveryCodeChallengeNewCode } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';

function ContinueButton() {
  const { continueMethod } = useMfaRecoveryCodeChallengeNewCode();
  return (
    <button onClick={() => continueMethod()}>
      I've Saved My Code
    </button>
  );
}

共通/ユーティリティHooks

このHooksは、ブランディングコンテキストからフラット化された設定を含む現在のテーマオプションを取得します。
このHooksは、現在の ACUL 画面の表示言語を変更する関数を返します。
このHooksは、現在の画面のコンテキストと state を取得します。
このHooksは、画面上のサーバー、クライアント、開発者の各エラーを読み取り、管理します。