* update oauth tests * fix parseRequestData * add logging * add fallback * use ?? * updates * use parseUrlFormData in saml/callback * update tests * fix * remove log * update * any -> unknown * use HttpErrors * addressed * unknown -> any * feat: Add entry report wrapper to every api route in appDir * fix * fix unit test * fix
16 lines
660 B
TypeScript
16 lines
660 B
TypeScript
import { defaultResponderForAppDir } from "app/api/defaultResponderForAppDir";
|
|
import { parseRequestData } from "app/api/parseRequestData";
|
|
import type { NextRequest } from "next/server";
|
|
import { NextResponse } from "next/server";
|
|
|
|
import jackson from "@calcom/features/ee/sso/lib/jackson";
|
|
import type { OAuthTokenReq } from "@calcom/features/ee/sso/lib/jackson";
|
|
|
|
async function handler(req: NextRequest) {
|
|
const { oauthController } = await jackson();
|
|
const tokenResponse = await oauthController.token((await parseRequestData(req)) as OAuthTokenReq);
|
|
return NextResponse.json(tokenResponse);
|
|
}
|
|
|
|
export const POST = defaultResponderForAppDir(handler);
|