Skip to main content

create_user

Function create_user 

Source
pub async fn create_user(new: NewUser<'_>) -> Result<Account, ConfigError>
Expand description

Inserts a directory row for a freshly provisioned tenant.

verified is set here rather than by changing 0003_users.sql’s default: that migration is applied in the global database and in live tenants, so editing it would change its checksum and fail every boot.

§Errors

ConfigError::DB when the directory is unreachable, and the underlying sqlx error when the insert itself fails — a concurrent registration winning the UNIQUE (email) race reaches the caller as an error so it can drop the database it already provisioned.