Auth and session middleware.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { getWebsite, getSession, createSession } from 'lib/db';
|
||||
import { getCountry, getDevice, getIpAddress } from 'lib/utils';
|
||||
import { getCountry, getDevice, getIpAddress } from 'lib/request';
|
||||
import { uuid, isValidId, verifyToken } from 'lib/crypto';
|
||||
|
||||
export default async req => {
|
||||
@@ -46,6 +46,8 @@ export default async req => {
|
||||
session_id,
|
||||
session_uuid,
|
||||
};
|
||||
} else {
|
||||
throw new Error(`Invalid website: ${website_uuid}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user