make captcha case-insensitive

This commit is contained in:
David Sterry 2021-07-04 17:51:08 -07:00 committed by Felix Ableitner
parent 53fc8600fe
commit b21d240996

View file

@ -249,7 +249,7 @@ impl Handler<CheckCaptcha> for ChatServer {
let check = self let check = self
.captchas .captchas
.iter() .iter()
.any(|r| r.uuid == msg.uuid && r.answer == msg.answer); .any(|r| r.uuid == msg.uuid && r.answer.to_lowercase() == msg.answer.to_lowercase());
// Remove this uuid so it can't be re-checked (Checks only work once) // Remove this uuid so it can't be re-checked (Checks only work once)
self.captchas.retain(|x| x.uuid != msg.uuid); self.captchas.retain(|x| x.uuid != msg.uuid);