mfa-recovery-code-challenge-new-code 画面では、認証が正常に完了すると、新しいリカバリーコードがユーザーに表示され、安全な場所に保存するよう求められます。
各画面には、それぞれ固有のHooksとメソッドがあります。SDK は、各画面について partial import と root import をサポートしています。
- partial import を使用すると、特定のユースケースに必要なコードだけを含めることができます。
- root import を使用すると、すべての画面を単一のバンドルから読み込めます。これは、想定されるすべての画面に対応する単一のビルドを使用したい場合に便利です。
// ルートインポート
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>
);
}
mfa-recovery-code-challenge-new-code 画面で、Auth0 のコンテキストデータへの読み取り専用アクセスを提供する画面スコープのHooksです。@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code からインポートします。
このHooksは、mfa-recovery-code-challenge-new-code 画面に表示されるロゴ、色、テーマ設定などのブランディング設定を提供します。import { useBranding } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function CustomTheme() {
const branding = useBranding();
}
このHooksは、mfa-recovery-code-challenge-new-code 画面の id、name、logoUrl などのクライアント関連の設定を提供します。import { useClient } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function AppInfo() {
const client = useClient();
}
このHooksは、MFA フローが組織スコープの場合に、ユーザーの組織に関する情報を提供します。組織コンテキストが存在しない場合は null を返します。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>;
}
}
このHooksには、認証フロー内の現在のプロンプトに関するデータが含まれます。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 画面固有の詳細 (設定やコンテキストなど) が含まれます。import { useScreen } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function ScreenDebug() {
const screen = useScreen();
}
このHooksには、id や関連するメタデータなど、テナントに関するデータが含まれます。import { useTenant } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function TenantInfo() {
const tenant = useTenant();
}
このHooksは、現在の MFA フローの状態など、mfa-recovery-code-challenge-new-code 画面のトランザクション固有データを提供します。import { useTransaction } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function TransactionInfo() {
const transaction = useTransaction();
}
このHooksは、URL パラメーターから事前入力された値など、画面に渡される信頼できないデータを扱います。import { useUntrustedData } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge-new-code';
function PrefilledForm() {
const untrustedData = useUntrustedData();
}
このHooksは、username、email、利用可能な認証方法など、現在アクティブなユーザーの詳細を提供します。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 画面で利用できるすべてのメソッドとコンテキストを返します。
このメソッドは、ユーザーが新しいリカバリーコードを保存済みであることを確認し、認証フローを続行します。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は、現在の ACUL 画面の表示言語を変更する関数を返します。
このHooksは、現在の画面のコンテキストと state を取得します。
このHooksは、画面上のサーバー、クライアント、開発者の各エラーを読み取り、管理します。