mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Minor tweaks.
This commit is contained in:
parent
132bbcbe0d
commit
0edf87941a
6 changed files with 24 additions and 22 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
const prisma = new PrismaClient({
|
||||
log: [process.env.NODE_ENV !== 'production' && 'query'],
|
||||
});
|
||||
|
||||
export async function runQuery(query) {
|
||||
return query
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { getWebsite, getSession, createSession } from 'lib/db';
|
||||
import { getCountry, getDevice, getIpAddress, hash, isValidSession } from 'lib/utils';
|
||||
|
||||
export default async function checkSession(req) {
|
||||
export default async req => {
|
||||
const { payload } = req.body;
|
||||
const { session } = payload;
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ export default async function checkSession(req) {
|
|||
|
||||
if (website) {
|
||||
const { website_id } = website;
|
||||
const session_uuid = hash(`${website_id}${hostname}${ip}${userAgent}${os}`);
|
||||
const session_uuid = hash(website_id, hostname, ip, userAgent, os);
|
||||
|
||||
let session = await getSession(session_uuid);
|
||||
|
||||
|
|
@ -46,4 +46,4 @@ export default async function checkSession(req) {
|
|||
].join(':');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue