chore: migrate /auth/saml-idp (#18943)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import type { PageProps } from "app/_types";
|
||||
import { notFound } from "next/navigation";
|
||||
import { z } from "zod";
|
||||
|
||||
import SamlIdpClient from "~/auth/saml-idp/saml-idp-view";
|
||||
|
||||
const querySchema = z.object({
|
||||
code: z.string(),
|
||||
});
|
||||
|
||||
export default async function SamlIdpPage({ searchParams }: PageProps) {
|
||||
const parsed = querySchema.safeParse(searchParams);
|
||||
if (!parsed.success) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
return <SamlIdpClient code={parsed.data.code} />;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
export { default } from "~/auth/saml-idp/saml-idp-view";
|
||||
@@ -163,6 +163,7 @@ export const config = {
|
||||
"/auth/verify-email-change",
|
||||
"/auth/verify-email",
|
||||
"/auth/verify",
|
||||
"/auth/saml-idp",
|
||||
"/auth/setup",
|
||||
/**
|
||||
* Paths required by routingForms.handle
|
||||
|
||||
@@ -3,15 +3,9 @@
|
||||
import { signIn } from "next-auth/react";
|
||||
import { useEffect } from "react";
|
||||
|
||||
import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";
|
||||
|
||||
// To handle the IdP initiated login flow callback
|
||||
export default function SamlIdp() {
|
||||
const searchParams = useCompatSearchParams();
|
||||
|
||||
export default function SamlIdp({ code }: { code: string }) {
|
||||
useEffect(() => {
|
||||
const code = searchParams?.get("code");
|
||||
|
||||
signIn("saml-idp", {
|
||||
callbackUrl: "/",
|
||||
code,
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export { default } from "~/auth/saml-idp/saml-idp-view";
|
||||
Reference in New Issue
Block a user