fix: restore login by defining getClientIp helper
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user