v0.2.17
RustBox CI / rustbox (push) Canceled after 0s

This commit is contained in:
Mateusz Gruszczyński committed 2026-11-03 10:35:05 +01:00
1 parent 2ac1566eca
commit 1bb398acd1
32 files changed
+907 -136

No files matched your search

+18
View File
@@ -33,6 +33,7 @@ pub struct SessionPolicyResponse {
sieve_enabled: bool,
diagnostics_enabled: bool,
about_enabled: bool,
multi_account_enabled: bool,
}
pub async fn session_policy(
@@ -43,6 +44,7 @@ pub async fn session_policy(
sieve_enabled: config.sieve_enabled,
diagnostics_enabled: config.diagnostics_enabled,
about_enabled: config.about_enabled,
multi_account_enabled: config.multi_account_enabled,
})
}
@@ -246,6 +248,22 @@ pub async fn login(
)
.into_response();
}
if !config.multi_account_enabled && !existing_accounts.is_empty() {
return (
StatusCode::FORBIDDEN,
[("content-type", "application/json")],
serde_json::json!({
"error": {
"code": "MULTI_ACCOUNT_DISABLED",
"message": "Multiple accounts are disabled by the RustBox administrator",
"status": 403
}
})
.to_string(),
)
.into_response();
}
}
let user_hash = user_data::hash_email(&body.email);