mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-07 18:08:04 +01:00
Update reset website logic.
This commit is contained in:
parent
7148ab6374
commit
499ba96348
@ -1,5 +1,5 @@
|
|||||||
import { NextApiRequestQueryBody } from 'lib/types';
|
import { NextApiRequestQueryBody } from 'lib/types';
|
||||||
import { canViewWebsite } from 'lib/auth';
|
import { canUpdateWebsite } from 'lib/auth';
|
||||||
import { useAuth, useCors } from 'lib/middleware';
|
import { useAuth, useCors } from 'lib/middleware';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
|
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
|
||||||
@ -19,7 +19,7 @@ export default async (
|
|||||||
const { id: websiteId } = req.query;
|
const { id: websiteId } = req.query;
|
||||||
|
|
||||||
if (req.method === 'POST') {
|
if (req.method === 'POST') {
|
||||||
if (!(await canViewWebsite(req.auth, websiteId))) {
|
if (!(await canUpdateWebsite(req.auth, websiteId))) {
|
||||||
return unauthorized(res);
|
return unauthorized(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user