2023-03-07 21:31:39 +00:00
|
|
|
import { signIn } from "next-auth/react";
|
|
|
|
import { useRouter } from "next/router";
|
|
|
|
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() {
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
if (!router.isReady) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const { code } = router.query;
|
|
|
|
|
|
|
|
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;
|