2023-03-07 21:31:39 +00:00
|
|
|
import { signIn } from "next-auth/react";
|
2023-08-02 09:35:48 +00:00
|
|
|
import { useSearchParams } from "next/navigation";
|
2023-03-07 21:31:39 +00:00
|
|
|
import { useEffect } from "react";
|
|
|
|
|
2023-04-18 18:45:32 +00:00
|
|
|
import PageWrapper from "@components/PageWrapper";
|
|
|
|
|
2023-03-07 21:31:39 +00:00
|
|
|
// To handle the IdP initiated login flow callback
|
|
|
|
export default function Page() {
|
2023-08-02 09:35:48 +00:00
|
|
|
const searchParams = useSearchParams();
|
2023-03-07 21:31:39 +00:00
|
|
|
|
|
|
|
useEffect(() => {
|
2023-08-02 09:35:48 +00:00
|
|
|
const code = searchParams?.get("code");
|
2023-03-07 21:31:39 +00:00
|
|
|
|
|
|
|
signIn("saml-idp", {
|
|
|
|
callbackUrl: "/",
|
|
|
|
code,
|
|
|
|
});
|
2023-06-06 11:59:57 +00:00
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
2023-03-07 21:31:39 +00:00
|
|
|
}, []);
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
2023-04-18 18:45:32 +00:00
|
|
|
Page.PageWrapper = PageWrapper;
|