Minor tweaks.

This commit is contained in:
Mike Cao 2020-07-20 19:24:33 -07:00
parent 132bbcbe0d
commit 0edf87941a
6 changed files with 24 additions and 22 deletions

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(':');
}
}
}
};