From 6dc4cbe44849a46928c93f3a0d89f9670baf4a01 Mon Sep 17 00:00:00 2001 From: Owen Date: Wed, 29 Oct 2025 16:24:35 -0700 Subject: [PATCH] Check country code --- server/routers/badger/verifySession.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/routers/badger/verifySession.ts b/server/routers/badger/verifySession.ts index 085ad6b6..eec83d0f 100644 --- a/server/routers/badger/verifySession.ts +++ b/server/routers/badger/verifySession.ts @@ -948,7 +948,7 @@ async function checkRules( } else if ( clientIp && rule.match == "COUNTRY" && - (await isIpInGeoIP(clientIp, rule.value)) + (await isIpInGeoIP(ipCC, rule.value)) ) { return rule.action as any; } @@ -1077,15 +1077,13 @@ export function isPathAllowed(pattern: string, path: string): boolean { } async function isIpInGeoIP( - ipCountryCode: string, + ipCountryCode: string | undefined, checkCountryCode: string ): Promise { if (checkCountryCode == "ALL") { return true; } - logger.debug(`IP ${ipCountryCode} is in country: ${checkCountryCode}`); - return ipCountryCode?.toUpperCase() === checkCountryCode.toUpperCase(); }