Removed session code.

This commit is contained in:
Mike Cao 2020-08-20 19:17:27 -07:00
parent 343e59e6ff
commit 5cade59111
6 changed files with 47 additions and 53 deletions

View file

@ -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);