mirror of
https://github.com/umami-software/umami.git
synced 2026-02-17 11:05:36 +01:00
Fixed share page.
This commit is contained in:
parent
cb4c8accea
commit
4c202741c2
11 changed files with 58 additions and 39 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { NextApiRequestQueryBody } from 'lib/types';
|
||||
import { canViewWebsite } from 'lib/auth';
|
||||
import { canUpdateWebsite } from 'lib/auth';
|
||||
import { useAuth, useCors } from 'lib/middleware';
|
||||
import { NextApiResponse } from 'next';
|
||||
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
|
||||
|
|
@ -22,7 +22,9 @@ export default async (
|
|||
const { id: websiteId } = req.query;
|
||||
|
||||
if (req.method === 'POST') {
|
||||
if (!(await canViewWebsite(userId, websiteId))) {
|
||||
const canUpdate = await canUpdateWebsite(userId, websiteId);
|
||||
|
||||
if (!canUpdate) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue