Changed JWT implementation.
This commit is contained in:
1 parent
cb0c912c5b
commit
f3f0ad15f2
6 files changed
+48
-13
No files matched your search
+2
-2
@@ -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