pub struct BetterAuth { /* private fields */ }Expand description
The main BetterAuth instance
Implementations§
Source§impl BetterAuth
impl BetterAuth
Sourcepub fn new(config: AuthConfig) -> AuthBuilder
pub fn new(config: AuthConfig) -> AuthBuilder
Create a new BetterAuth builder
Sourcepub async fn handle_request(&self, req: AuthRequest) -> AuthResult<AuthResponse>
pub async fn handle_request(&self, req: AuthRequest) -> AuthResult<AuthResponse>
Handle an authentication request
Sourcepub fn config(&self) -> &AuthConfig
pub fn config(&self) -> &AuthConfig
Get the configuration
Sourcepub fn database(&self) -> &Arc<dyn DatabaseAdapter>
pub fn database(&self) -> &Arc<dyn DatabaseAdapter>
Get the database adapter
Sourcepub fn session_manager(&self) -> &SessionManager
pub fn session_manager(&self) -> &SessionManager
Get the session manager
Sourcepub fn routes(&self) -> Vec<(String, &dyn AuthPlugin)>
pub fn routes(&self) -> Vec<(String, &dyn AuthPlugin)>
Get all routes from plugins
Sourcepub fn plugins(&self) -> &Vec<Box<dyn AuthPlugin>>
pub fn plugins(&self) -> &Vec<Box<dyn AuthPlugin>>
Get all plugins (useful for Axum integration)
Sourcepub fn get_plugin(&self, name: &str) -> Option<&dyn AuthPlugin>
pub fn get_plugin(&self, name: &str) -> Option<&dyn AuthPlugin>
Get plugin by name
Sourcepub fn plugin_names(&self) -> Vec<&'static str>
pub fn plugin_names(&self) -> Vec<&'static str>
List all plugin names
Auto Trait Implementations§
impl Freeze for BetterAuth
impl !RefUnwindSafe for BetterAuth
impl Send for BetterAuth
impl Sync for BetterAuth
impl Unpin for BetterAuth
impl !UnwindSafe for BetterAuth
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