mirror of
https://github.com/umami-software/umami.git
synced 2026-02-17 19:15:37 +01:00
Enable public website sharing.
This commit is contained in:
parent
48a524e09c
commit
560f1316c1
36 changed files with 294 additions and 61 deletions
|
|
@ -3,9 +3,6 @@ import { useAuth } from 'lib/middleware';
|
|||
import { methodNotAllowed, ok, unauthorized } from 'lib/response';
|
||||
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
const { user_id, is_admin } = req.auth;
|
||||
const { id } = req.query;
|
||||
const website_id = +id;
|
||||
|
||||
|
|
@ -16,6 +13,9 @@ export default async (req, res) => {
|
|||
}
|
||||
|
||||
if (req.method === 'DELETE') {
|
||||
await useAuth(req, res);
|
||||
const { user_id, is_admin } = req.auth;
|
||||
|
||||
const website = await getWebsiteById(website_id);
|
||||
|
||||
if (website.user_id === user_id || is_admin) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue