mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 09:05:36 +01:00
Fixed change password issue. API refactoring. Closes #1592.
This commit is contained in:
parent
994cf950c8
commit
ac070d3ce9
24 changed files with 74 additions and 111 deletions
|
|
@ -2,6 +2,7 @@ import { resetWebsite } from 'queries';
|
|||
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
|
||||
import { allowQuery } from 'lib/auth';
|
||||
import { useAuth, useCors } from 'lib/middleware';
|
||||
import { TYPE_WEBSITE } from 'lib/constants';
|
||||
|
||||
export default async (req, res) => {
|
||||
await useCors(req, res);
|
||||
|
|
@ -10,7 +11,7 @@ export default async (req, res) => {
|
|||
const { id: websiteId } = req.query;
|
||||
|
||||
if (req.method === 'POST') {
|
||||
if (!(await allowQuery(req))) {
|
||||
if (!(await allowQuery(req, TYPE_WEBSITE))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue