Fixed change password issue. API refactoring. Closes #1592.

This commit is contained in:
Mike Cao committed 2022-10-25 10:45:56 -07:00
1 parent 994cf950c8
commit ac070d3ce9
24 files changed
+74 -111

No files matched your search

+2 -1
View File
@@ -3,13 +3,14 @@ import { getEventData } from 'queries';
import { ok, badRequest, methodNotAllowed, 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);
await useAuth(req, res);
if (req.method === 'POST') {
if (!(await allowQuery(req))) {
if (!(await allowQuery(req, TYPE_WEBSITE))) {
return unauthorized(res);
}