A plugin for Torii that provides email and password authentication.
This plugin allows users to register and authenticate using an email address and password. It handles password hashing, validation.
Usage
use PasswordPlugin;
use SqliteStorage;
use PluginManager;
use Arc;
let user_storage = new;
let plugin = new;
let mut manager = new;
manager.register_plugin;
// Register a new user
let plugin = manager..unwrap;
let user = plugin.register_user_with_password.await?;
// Login an existing user
let user = plugin.login_user_with_password.await?;
The password plugin requires a storage implementation that implements the [PasswordStorage]
trait for storing user credentials.
Features
- User registration with email and password
- Password hashing and validation
- Optional email verification
- Event emission for authentication events