fix: restore login by defining getClientIp helper

This commit is contained in:
2026-02-19 19:08:12 +08:00
parent 19f53875c9
commit 50d41cb7ae

View File

@@ -2852,6 +2852,15 @@ function normalizeClientIp(rawIp) {
return ip; return ip;
} }
function getClientIp(req) {
return normalizeClientIp(
req?.ip
|| req?.socket?.remoteAddress
|| req?.connection?.remoteAddress
|| ''
);
}
function parseShareIpWhitelist(rawValue) { function parseShareIpWhitelist(rawValue) {
if (typeof rawValue !== 'string') return []; if (typeof rawValue !== 'string') return [];
return rawValue return rawValue