fix null ip lookup error
This commit is contained in:
@@ -79,10 +79,10 @@ export async function getClientInfo(req, { screen }) {
|
|||||||
const userAgent = req.headers['user-agent'];
|
const userAgent = req.headers['user-agent'];
|
||||||
const ip = getIpAddress(req);
|
const ip = getIpAddress(req);
|
||||||
const location = await getLocation(ip);
|
const location = await getLocation(ip);
|
||||||
const country = location.country;
|
const country = location?.country;
|
||||||
const subdivision1 = location.subdivision1;
|
const subdivision1 = location?.subdivision1;
|
||||||
const subdivision2 = location.subdivision2;
|
const subdivision2 = location?.subdivision2;
|
||||||
const city = location.city;
|
const city = location?.city;
|
||||||
const browser = browserName(userAgent);
|
const browser = browserName(userAgent);
|
||||||
const os = detectOS(userAgent);
|
const os = detectOS(userAgent);
|
||||||
const device = getDevice(screen, browser, os);
|
const device = getDevice(screen, browser, os);
|
||||||
|
|||||||
Reference in New Issue
Block a user