diff --git a/src/methods/account_recover.rs b/src/methods/account_recover.rs index 650c9d5..3c50db5 100644 --- a/src/methods/account_recover.rs +++ b/src/methods/account_recover.rs @@ -34,7 +34,7 @@ pub mod password { if let Some(mail) = &email { if mail.trim().ends_with("@skynet.ie") { // all responses from this are a success - return Ok(json!({"result": "success"}).into()); + return Ok(json!({"result": "error", "error": "Skynet email not permitted."}).into()); } } @@ -51,6 +51,7 @@ pub mod password { // user does not have a different email address set if user_details.mail.trim().ends_with("@skynet.ie") { + // not returning an error here as there is no need to let the person requesting what email the user has return Ok(json!({"result": "success"}).into()); } diff --git a/src/methods/account_update.rs b/src/methods/account_update.rs index 0bb85dc..1e9a144 100644 --- a/src/methods/account_update.rs +++ b/src/methods/account_update.rs @@ -36,7 +36,7 @@ pub async fn submit(mut req: Request) -> tide::Result { // 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()); + return Ok(json!({"result": "error", "error": "Skynet email not valid contact address"}).into()); } let config = &req.state().config;