mirror of
https://github.com/umami-software/umami.git
synced 2026-02-15 10:05:36 +01:00
API security updates.
This commit is contained in:
parent
01432266ef
commit
8e3286179a
7 changed files with 115 additions and 80 deletions
|
|
@ -1,11 +1,18 @@
|
|||
import { getActiveVisitors } from 'lib/queries';
|
||||
import { ok } from 'lib/response';
|
||||
import { methodNotAllowed, ok } from 'lib/response';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
|
||||
export default async (req, res) => {
|
||||
const { id } = req.query;
|
||||
const website_id = +id;
|
||||
await useAuth(req, res);
|
||||
|
||||
const result = await getActiveVisitors(website_id);
|
||||
if (req.method === 'GET') {
|
||||
const { id } = req.query;
|
||||
const website_id = +id;
|
||||
|
||||
return ok(res, result);
|
||||
const result = await getActiveVisitors(website_id);
|
||||
|
||||
return ok(res, result);
|
||||
}
|
||||
|
||||
return methodNotAllowed(res);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue