diff --git a/src/methods/account_update.rs b/src/methods/account_update.rs index 8733210..6ec2bac 100644 --- a/src/methods/account_update.rs +++ b/src/methods/account_update.rs @@ -22,6 +22,11 @@ pub async fn post_update_ldap(mut req: Request) -> tide::Result { value, } = req.body_json().await?; + // check that any mail is not using @skynet.ie + if field == "mail" && value.trim().ends_with("@skynet.ie") { + return Ok(json!({"result": "error", "error": "skynet email not valid contact address"}).into()); + } + let config = &req.state().config; // easier to give each request its own connection