pub struct EmailVerificationConfig {
pub verification_token_expiry: TimeDelta,
pub send_email_notifications: 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<Arc<dyn Fn(&User) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>> + Send + Sync>>,
pub after_email_verification: Option<Arc<dyn Fn(&User) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>> + Send + Sync>>,
}Fields§
§verification_token_expiry: TimeDeltaHow long a verification token stays valid. Default: 24 hours.
send_email_notifications: boolWhether to send email notifications (on sign-up). Default: true.
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<Arc<dyn Fn(&User) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>> + Send + Sync>>Hook invoked before email verification (before updating the user).
after_email_verification: Option<Arc<dyn Fn(&User) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>> + Send + Sync>>Hook invoked after email verification (after the user has been updated).
Implementations§
Source§impl EmailVerificationConfig
impl EmailVerificationConfig
Sourcepub fn expiry_hours(&self) -> i64
pub fn expiry_hours(&self) -> i64
Backward-compatible helper: return the expiry duration expressed as whole hours (truncated).