cal.pub0.org/apps/web/pages/auth/saml-idp.tsx

24 lines
435 B
TypeScript
Raw Normal View History

import { signIn } from "next-auth/react";
import { useRouter } from "next/router";
import { useEffect } from "react";
// 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,
});
}, []);
return null;
}