mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
Implement session caching.
This commit is contained in:
parent
0b131392fc
commit
3d1dc08491
4 changed files with 31 additions and 11 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import isBot from 'isbot-fast';
|
||||
import { savePageView, saveEvent } from 'lib/queries';
|
||||
import { useCors, useSession } from 'lib/middleware';
|
||||
import { ok, badRequest } from 'lib/response';
|
||||
import isBot from 'isbot-fast';
|
||||
import { createToken } from 'lib/crypto';
|
||||
|
||||
export default async (req, res) => {
|
||||
if (isBot(req.headers['user-agent'])) {
|
||||
|
|
@ -28,5 +29,7 @@ export default async (req, res) => {
|
|||
return badRequest(res);
|
||||
}
|
||||
|
||||
return ok(res);
|
||||
const token = await createToken({ website_id, session_id });
|
||||
|
||||
return ok(res, token);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue