1 parent
2ac1566eca
commit
1bb398acd1
32 files changed
+907
-136
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user