Merge pull request #1649 from weex/case-insensitive-captcha

make captcha case-insensitive
upgrade_deps_5
Dessalines 2021-07-05 09:49:35 -04:00 committed by GitHub
commit 8c957ca939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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);