Auth and session middleware.
This commit is contained in:
1 parent
590a70c2ff
commit
d81ee3932d
14 files changed
+142
-73
No files matched your search
+3
-1
@@ -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