fix: disallow using skynet email as a contact address

closes #1
This commit is contained in:
silver 2023-07-29 17:16:29 +01:00
parent 115f5a5c31
commit 77917477fe

View file

@ -22,6 +22,11 @@ pub async fn post_update_ldap(mut req: Request<State>) -> 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