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(&UserView) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>> + Send + Sync>>,
pub after_email_verification: Option<Arc<dyn Fn(&UserView) -> 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(&UserView) -> 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(&UserView) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>> + Send + Sync>>Hook invoked after email verification (after the user has been updated).
Trait Implementations§
Source§impl Default for EmailVerificationConfig
impl Default for EmailVerificationConfig
Source§fn default() -> EmailVerificationConfig
fn default() -> EmailVerificationConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for EmailVerificationConfig
impl !UnwindSafe for EmailVerificationConfig
impl Freeze for EmailVerificationConfig
impl Send for EmailVerificationConfig
impl Sync for EmailVerificationConfig
impl Unpin for EmailVerificationConfig
impl UnsafeUnpin for EmailVerificationConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more