Minor tweaks.

This commit is contained in:
Mike Cao committed 2020-07-20 19:24:33 -07:00
1 parent 132bbcbe0d
commit 0edf87941a
6 files changed
+24 -22

No files matched your search

+3 -3
View File
@@ -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(':');
}
}
}
};