Added device collection.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { getWebsite, getSession, createSession } from 'lib/db';
|
||||
import { getCountry, getDevice, getIpAddress } from 'lib/request';
|
||||
import { getClientInfo } from 'lib/request';
|
||||
import { uuid, isValidId, verifyToken } from 'lib/crypto';
|
||||
|
||||
export async function verifySession(req) {
|
||||
@@ -13,9 +13,7 @@ export async function verifySession(req) {
|
||||
try {
|
||||
return await verifyToken(session);
|
||||
} catch {
|
||||
const ip = getIpAddress(req);
|
||||
const { userAgent, browser, os } = getDevice(req);
|
||||
const country = await getCountry(req, ip);
|
||||
const { userAgent, browser, os, ip, country, device } = await getClientInfo(req, payload);
|
||||
|
||||
if (website_uuid) {
|
||||
const website = await getWebsite({ website_uuid });
|
||||
@@ -35,6 +33,7 @@ export async function verifySession(req) {
|
||||
screen,
|
||||
language,
|
||||
country,
|
||||
device,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user