Removed session code.
This commit is contained in:
@@ -68,13 +68,13 @@ export async function getCountry(req, ip) {
|
||||
|
||||
lookup.close();
|
||||
|
||||
return result.country.iso_code;
|
||||
return result?.country?.iso_code;
|
||||
}
|
||||
|
||||
export async function getClientInfo(req, { screen }) {
|
||||
const userAgent = req.headers['user-agent'];
|
||||
const ip = getIpAddress(req);
|
||||
const country = await getCountry(req, ip);
|
||||
const userAgent = req.headers['user-agent'];
|
||||
const browser = browserName(userAgent);
|
||||
const os = detectOS(userAgent);
|
||||
const device = getDevice(screen, browser, os);
|
||||
|
||||
Reference in New Issue
Block a user