Crate better_auth

Source
Expand description

§Better Auth - Rust

A comprehensive authentication framework for Rust, inspired by Better-Auth.

§Quick Start

use better_auth::{BetterAuth, AuthConfig};
use better_auth::plugins::EmailPasswordPlugin;
 
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = AuthConfig::new("your-secret-key");
     
    let auth = BetterAuth::new(config)
        .plugin(EmailPasswordPlugin::new())
        .build()
        .await?;
         
    Ok(())
}

Re-exports§

pub use core::BetterAuth;
pub use core::AuthBuilder;
pub use core::AuthConfig;
pub use error::AuthError;
pub use error::AuthResult;
pub use types::User;
pub use types::Session;
pub use types::Account;
pub use types::Verification;
pub use types::AuthRequest;
pub use types::AuthResponse;
pub use types::CreateVerification;

Modules§

adapters
core
error
handlers
plugins
types