add bot protection

This commit is contained in:
Henry Hiles 2025-10-29 10:46:39 -04:00
commit d2b531f953
No known key found for this signature in database

View file

@ -130,11 +130,14 @@ If you have any issues, reply to this email.""",
(Router()..post("/", (Request request) async {
final settings = container.read(SettingsController.provider)!;
try {
final body = await request.readAsString();
final body = Uri.splitQueryString(await request.readAsString());
if (body["honeypot"]?.isNotEmpty == true) {
return Response.movedPermanently(
"https://ipv4.games/claim?name=federated.nexus",
);
}
final registration = Registration.fromJson(
Uri.splitQueryString(
body,
).map((key, value) => MapEntry(key, value.toLowerCase())),
body.map((key, value) => MapEntry(key, value.toLowerCase())),
);
final client = await container.read(