* migrate oidc * migrate saml apis * remove comment * add force-dynamic * fix * fix * refactor --------- Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
22 lines
663 B
TypeScript
22 lines
663 B
TypeScript
import { defaultResponderForAppDir } from "app/api/defaultResponderForAppDir";
|
|
import type { NextRequest } from "next/server";
|
|
import { NextResponse } from "next/server";
|
|
|
|
import jackson from "@calcom/features/ee/sso/lib/jackson";
|
|
|
|
async function handler(req: NextRequest) {
|
|
const { oauthController } = await jackson();
|
|
|
|
const { redirect_url } = await oauthController.samlResponse(await req.json());
|
|
|
|
if (redirect_url) {
|
|
return NextResponse.redirect(redirect_url, 302);
|
|
}
|
|
|
|
return NextResponse.json({ message: "No redirect URL provided" }, { status: 400 });
|
|
}
|
|
|
|
const postHandler = defaultResponderForAppDir(handler);
|
|
|
|
export { postHandler as POST };
|