diff --git a/apps/web/app/future/auth/new/page.tsx b/apps/web/app/future/auth/new/page.tsx new file mode 100644 index 00000000000000..87df23a99f8f81 --- /dev/null +++ b/apps/web/app/future/auth/new/page.tsx @@ -0,0 +1,5 @@ +import { redirect } from "next/navigation"; + +export default function Page() { + redirect(process.env.NEXT_PUBLIC_WEBAPP_URL || "https://app.cal.com"); +} diff --git a/apps/web/app/future/auth/saml-idp/page.tsx b/apps/web/app/future/auth/saml-idp/page.tsx new file mode 100644 index 00000000000000..02911d67e0fbeb --- /dev/null +++ b/apps/web/app/future/auth/saml-idp/page.tsx @@ -0,0 +1 @@ +export { default } from "~/auth/saml-idp/saml-idp-view"; diff --git a/apps/web/modules/auth/saml-idp/saml-idp-view.tsx b/apps/web/modules/auth/saml-idp/saml-idp-view.tsx new file mode 100644 index 00000000000000..975e4658778501 --- /dev/null +++ b/apps/web/modules/auth/saml-idp/saml-idp-view.tsx @@ -0,0 +1,23 @@ +"use client"; + +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(); + + useEffect(() => { + const code = searchParams?.get("code"); + + signIn("saml-idp", { + callbackUrl: "/", + code, + }); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + return null; +} diff --git a/apps/web/pages/auth/saml-idp.tsx b/apps/web/pages/auth/saml-idp.tsx index 661980fa686cc2..02911d67e0fbeb 100644 --- a/apps/web/pages/auth/saml-idp.tsx +++ b/apps/web/pages/auth/saml-idp.tsx @@ -1,21 +1 @@ -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 Page() { - const searchParams = useCompatSearchParams(); - - useEffect(() => { - const code = searchParams?.get("code"); - - signIn("saml-idp", { - callbackUrl: "/", - code, - }); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - return null; -} +export { default } from "~/auth/saml-idp/saml-idp-view";