chore: migrate saml/oidc APIs to App Router (#19515)
* migrate oidc * migrate saml apis * remove comment * add force-dynamic * fix * fix * refactor --------- Co-authored-by: sean-brydon <[email protected]>
This commit is contained in:
1 parent
631c5f7c53
commit
8d18b3da38
10 files changed
+144
-127
No files matched your search
@@ -0,0 +1,21 @@
|
||||
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 };
|
||||
Reference in new issue
Block a user