fix: check ip ban by prefix during login

This commit is contained in:
trisua 2025-05-21 23:52:29 -04:00
parent d7e800fcb4
commit 829eef7f5d
3 changed files with 12 additions and 4 deletions

View file

@ -133,7 +133,11 @@ pub async fn login_request(
.to_string();
// check for ip ban
if data.get_ipban_by_ip(&real_ip).await.is_ok() {
if data
.get_ipban_by_addr(RemoteAddr::from(real_ip.as_str()))
.await
.is_ok()
{
return (None, Json(Error::NotAllowed.into()));
}