Skip to main content

create_admin

Function create_admin 

Source
pub async fn create_admin(
    ex: &mut dyn Executor,
    email: &str,
    password: &str,
    display_name: &str,
) -> Result<AdminUser>
Expand description

Creates an active AdminUser that signs in with email and password, storing only the password’s Argon2id hash: the account a new app seeds to reach its panel.

tablo_core::auth::create_admin(&mut db, "admin@example.com", "secret", "Admin").await?;

§Errors

Hashing fails, or the insert does: an email another account holds is refused by its unique index.