pub struct EmailVerificationConfig {
pub verification_token_expiry: Duration,
pub send_email_notifications: bool,
pub send_on_sign_up: Option<bool>,
pub require_verification_for_signin: bool,
pub auto_verify_new_users: bool,
pub send_on_sign_in: bool,
pub auto_sign_in_after_verification: bool,
pub send_verification_email: Option<Arc<dyn SendVerificationEmail>>,
pub before_email_verification: Option<EmailVerificationHook>,
pub after_email_verification: Option<EmailVerificationHook>,
}Fields§
§verification_token_expiry: DurationHow long a verification token stays valid. Default: one hour.
send_email_notifications: boolWhether to send email notifications (on sign-up). Default: true.
send_on_sign_up: Option<bool>Send the verification challenge during password sign-up. When unset, the email/password requirement decides, as in the upstream defaults.
require_verification_for_signin: boolWhether email verification is required before sign-in. Default: false.
auto_verify_new_users: boolWhether to auto-verify newly created users. Default: false.
send_on_sign_in: boolWhen true, automatically send a verification email on sign-in if the user is unverified. Default: false.
auto_sign_in_after_verification: boolWhen true, create a session after email verification and return the session token in the verify-email response. Default: false.
send_verification_email: Option<Arc<dyn SendVerificationEmail>>Optional custom email sender. When set this overrides the default
EmailProvider-based sending.
before_email_verification: Option<EmailVerificationHook>Hook invoked before email verification (before updating the user).
after_email_verification: Option<EmailVerificationHook>Hook invoked after email verification (after the user has been updated).