1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-22 22:54:22 +00:00
festa/pages/api/auth/index.ts

19 lines
780 B
TypeScript
Raw Permalink Normal View History

2022-06-11 03:08:49 +00:00
import { NextApiRequest, NextApiResponse } from "next";
import { festaAPI } from "../../../utils/api";
import { festaNoConfig } from "../../../utils/api/configurator";
import { festaBearerAuthRequired, FestaToken } from "../../../utils/api/authenticator";
import { festaNoBody } from "../../../utils/api/bodyValidator";
import { festaDebugAuth } from "../../../utils/api/executor";
import { festaNoQuery } from "../../../utils/api/queryValidator";
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
await festaAPI(req, res, {
configurator: festaNoConfig,
authenticator: festaBearerAuthRequired,
queryValidator: festaNoQuery,
bodyValidator: festaNoBody,
executor: festaDebugAuth<FestaToken>(),
})
}