pub struct EmailOtpConfig {Show 14 fields
pub sender: Option<Arc<dyn SendEmailOtp>>,
pub otp_length: usize,
pub expires_in: Duration,
pub allowed_attempts: u32,
pub disable_sign_up: bool,
pub change_email: bool,
pub verify_current_email: bool,
pub reuse_otp: bool,
pub storage: EmailOtpStorage,
pub generate_otp: Option<EmailOtpGenerator>,
pub send_verification_on_sign_up: bool,
pub override_default_email_verification: bool,
pub rate_limit_window: f64,
pub rate_limit_max: f64,
}Expand description
Options for email OTP routes.
Fields§
§sender: Option<Arc<dyn SendEmailOtp>>OTP delivery callback; requests fail when no sender is configured.
otp_length: usizeNumber of decimal digits in a generated OTP. Default: 6.
expires_in: DurationOTP validity and resend extension. Default: 5 minutes.
allowed_attempts: u32Failed code attempts before the next check locks the code. Zero means 3.
disable_sign_up: boolPrevent email OTP from creating a new user.
change_email: boolEnable authenticated email changes.
verify_current_email: boolRequire the current mailbox’s verification OTP before email changes.
reuse_otp: boolReuse a valid recoverable code and extend its expiry on resend.
storage: EmailOtpStorageStored code protection. Default: plain.
generate_otp: Option<EmailOtpGenerator>Generate a custom OTP. Empty output uses the decimal generator.
send_verification_on_sign_up: boolSend a verification OTP after successful sign-up.
override_default_email_verification: boolReplace default email verification messages with OTP delivery.
rate_limit_window: f64Endpoint rate limit window. Zero means 60 seconds.
rate_limit_max: f64Endpoint rate limit maximum. Zero means 3.