現在の画面のコンテキストと state を取得する React Hook です。この Hook を使うと、カスタム authentication UI の構築に必要なクライアント設定、organization の詳細、画面の識別情報、
テナント設定、transaction state、認可パラメーターにアクセスできます。
戻り値
次のプロパティを持つCurrentScreenOptions オブジェクトを返します。利用できない場合は null を返します。client- アプリケーション識別子とメタデータorganization- 組織ID とメタデータ (Auth0 Organizations の場合)prompt- 現在の prompt 名 (例: “login”, “consent”, “mfa”)screen- 現在の画面名 (例: “login-id”, “login-password”, “mfa-otp-challenge”)tenant- 有効な locale を含むテナント設定transaction- transaction state、errors array、現在の localeuntrustedData- クライアントからの認可パラメーター (使用前に validate してください)
重要なポイント
- authentication 画面の条件付きレンダリングには
screen.nameを使用します - ネストされたプロパティは
nullの場合があるため、必ずオプショナルチェーン (?.) を使用してください - バリデーションエラーを表示するには
transaction.errorsを確認してください - organization 固有の branding にアクセスするには
organization.metadataを使用します
戻り値
CurrentScreenOptions | null現在の画面のコンテキストデータ。利用できない場合は nullBasic screen routing
Accessing multiple properties