pub async fn create_user(
__arg0: State<Arc<AppState>>,
__arg1: Json<UserCreateScheme>,
) -> Result<impl IntoResponse, (StatusCode, Json<Value>)>Expand description
Registers a new user in the system.
Creates a new User account with the provided UserCreateScheme credentials.
The password is hashed using Argon2 before being stored. Only administrators can create new users.
§Arguments
State(data): Application state containingAppStatefor database accessrequest:UserCreateSchemecontaining user details including first/last name, username, admin flag, and password
§Returns
200 OKon successful user creation400 Bad Requestif username/password missing or user already exists500 Internal Server Errorif database insertion fails
§Password Hashing
Uses Argon2 with a cryptographically secure random salt.