EmailOTPChallenge クラスは、email-otp-challenge 画面の機能を実装します。この画面では、メールアドレスに送信されたワンタイムパスコードの入力をユーザーに求めます。
EmailOTPChallenge画面マネージャーのインスタンスを作成します:
import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge' ;
const emailOTPChallengeManager = new EmailOTPChallenge ();
await emailOTPChallengeManager . submitCode ({ code: '123456' });
ブランディングテーマや設定などのブランディング関連の構成を提供します。
email-otp-challenge 画面の id、name、logoUrl など、クライアントに関連する構成を提供します。
id や name など、ユーザーの組織に関する情報を提供します。
認証フローにおける現在のプロンプトに関するデータを含みます。
構成やコンテキストなど、email-otp-challenge 画面固有の詳細を含みます。
id や関連メタデータなど、テナントに関連するデータを含みます。
アクティブな識別子やフローの状態など、email-otp-challenge 画面に関するトランザクション固有のデータを提供します。
メール OTP チャレンジフロー中のユーザー入力など、SDK に渡される信頼できないデータを扱います。
username、email、roles など、現在のユーザーの詳細を含みます。
このメソッドは、Universal Login ページの表示言語を変更します。 import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge' ;
const emailOTPChallengeManager = new EmailOTPChallenge ();
emailOTPChallengeManager . changeLanguage ({
language: 'fr' ,
});
メソッドパラメーター 変更先の言語のロケールコードです (例: 'en'、'fr'、'es') 。
'session' に設定すると、選択した言語はセッション中保持されます。
このメソッドは、コンテキストからトランザクションエラーの配列を取得します。エラーが存在しない場合は、空の配列を返します。
このメソッドは、新しい OTP コードをユーザーのメールアドレスに送信するようリクエストします。 import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge' ;
const emailOTPChallengeManager = new EmailOTPChallenge ();
await emailOTPChallengeManager . resendCode ();
このメソッドは、タイムアウト管理付きの再送機能を提供します。再送を実行し、ユーザーが再度再送できるようになるまでクールダウン期間を適用する startResend() メソッドを持つ ResendControl オブジェクトを返します。 import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge' ;
const emailOTPChallengeManager = new EmailOTPChallenge ();
const { startResend } = emailOTPChallengeManager . resendManager ({
timeoutSeconds: 15 ,
});
await startResend ();
メソッドパラメーター ユーザーが再度コードを再送できるようになるまでのクールダウン時間 (秒) です。
再送ステータスが変化するたびに呼び出されるコールバックです。残り秒数と、再送機能が現在無効になっているかどうかを返します。
クールダウンが終了し、再送が再び可能になったときに呼び出されるコールバックです。
このメソッドは、ユーザーが入力した OTP コードを送信します。 import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge' ;
const emailOTPChallengeManager = new EmailOTPChallenge ();
await emailOTPChallengeManager . submitCode ({ code: '123456' });
メソッドパラメーター 送信するためにユーザーが入力する OTP コードです。