fix(auth): cap admin initial quota to available disk space

The admin_create_user method was using hardcoded quota values (100GB for
admin, 1GB for user) instead of the capped_quota method that checks
available disk space. This could result in setting a quota higher than
the actual available disk space.

Fixes #92
This commit is contained in:
BillionClaw
2026-03-18 11:06:39 +08:00
parent 4b62499b8f
commit 5cf0266d24
@@ -736,14 +736,8 @@ impl AuthApplicationService {
_ => UserRole::User,
};
// Determine quota
let quota = dto.quota_bytes.unwrap_or_else(|| {
if role == UserRole::Admin {
107_374_182_400
} else {
1_073_741_824
}
});
// Determine quota, capped to available disk space
let quota = dto.quota_bytes.unwrap_or_else(|| self.capped_quota(&role));
// Hash password
let password_hash = self.password_hasher.hash_password(&dto.password).await?;