Skip to main content
Manages resend actions, such as resending a verification code, on ACUL screens.The hook:
  • Tracks the remaining cooldown time.
  • Reports whether the resend button should be disabled.
  • Provides a startResend() function that triggers a resend and starts the cooldown.
  • Stores the countdown in localStorage, so the countdown persists across the page reload that a resend causes.

Parameters

Optional configuration, for example timeoutSeconds and onTimeout.

Returns

UseResendReturnAn object with:
  • remaining — seconds left until the next resend is permitted.
  • disabled — true if resending is currently blocked.
  • startResend — triggers a resend immediately, if resending is allowed.

Supported Screens

  • email-identifier-challenge
  • email-otp-challenge
  • login-email-verification
  • login-passwordless-email-code
  • login-passwordless-sms-otp
  • mfa-email-challenge
  • mfa-sms-challenge
  • mfa-voice-challenge
  • phone-identifier-challenge
  • reset-password-mfa-email-challenge
  • reset-password-mfa-sms-challenge
  • reset-password-mfa-voice-challenge
Example

Remarks

  • The underlying ResendControl has no explicit teardown method; the hook does not require manual cleanup.
  • The hook re-initializes the resend manager if timeoutSeconds or onTimeout change.