pub struct AuthConfig {
pub secret: String,
pub base_url: String,
pub session: SessionConfig,
pub jwt: JwtConfig,
pub password: PasswordConfig,
pub email_provider: Option<Arc<dyn EmailProvider>>,
}Expand description
Main configuration for BetterAuth
Fields§
§secret: StringSecret key for signing tokens and sessions
base_url: StringBase URL for the authentication service
session: SessionConfigSession configuration
jwt: JwtConfigJWT configuration
password: PasswordConfigPassword configuration
email_provider: Option<Arc<dyn EmailProvider>>Email provider for sending emails (verification, password reset, etc.)
Implementations§
Source§impl AuthConfig
impl AuthConfig
pub fn new(secret: impl Into<String>) -> Self
pub fn base_url(self, url: impl Into<String>) -> Self
pub fn session_expires_in(self, duration: Duration) -> Self
pub fn jwt_expires_in(self, duration: Duration) -> Self
pub fn password_min_length(self, length: usize) -> Self
pub fn validate(&self) -> Result<(), AuthError>
Trait Implementations§
Source§impl Clone for AuthConfig
impl Clone for AuthConfig
Source§fn clone(&self) -> AuthConfig
fn clone(&self) -> AuthConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuthConfig
impl !RefUnwindSafe for AuthConfig
impl Send for AuthConfig
impl Sync for AuthConfig
impl Unpin for AuthConfig
impl !UnwindSafe for AuthConfig
Blanket Implementations§
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