chore: App-router-migration /auth/new and /auth/saml-idp (#16447)
* auth/new: add to app router * auth/saml-idp: add to app router * fix
This commit is contained in:
1 parent
1edd255846
commit
86cf8feb55
4 files changed
+30
-21
No files matched your search
@@ -0,0 +1,5 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default function Page() {
|
||||
redirect(process.env.NEXT_PUBLIC_WEBAPP_URL || "https://app.cal.com");
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from "~/auth/saml-idp/saml-idp-view";
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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";
|
||||
Reference in new issue
Block a user