mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Added device collection.
This commit is contained in:
parent
6e23a8a53b
commit
e17c9da3d5
6 changed files with 389 additions and 310 deletions
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue