Changed JWT implementation.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { getWebsite, getSession, createSession } from 'lib/db';
|
||||
import { getCountry, getDevice, getIpAddress } from 'lib/utils';
|
||||
import { uuid, parseToken, isValidHash } from 'lib/crypto';
|
||||
import { uuid, isValidHash, verifyToken } from 'lib/crypto';
|
||||
|
||||
export default async req => {
|
||||
const { payload } = req.body;
|
||||
@@ -11,7 +11,7 @@ export default async req => {
|
||||
}
|
||||
|
||||
try {
|
||||
return await parseToken(session);
|
||||
return await verifyToken(session);
|
||||
} catch {
|
||||
const ip = getIpAddress(req);
|
||||
const { userAgent, browser, os } = getDevice(req);
|
||||
|
||||
Reference in New Issue
Block a user