mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Auth and session middleware.
This commit is contained in:
parent
590a70c2ff
commit
d81ee3932d
14 changed files with 142 additions and 73 deletions
12
pages/api/website.js
Normal file
12
pages/api/website.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { getWebsites } from 'lib/db';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
const { user_id } = req.auth;
|
||||
|
||||
const websites = await getWebsites(user_id);
|
||||
|
||||
res.status(200).json({ websites });
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue