fix the issue "ReferenceError: window is not defined" (#8193)
Co-authored-by: Nafees Nazik <84864519+G3root@users.noreply.github.com> Co-authored-by: nafees nazik <nafeesnazik21@gmail.com>pull/8213/head^2
parent
a33847a878
commit
2fdadb98ac
|
@ -1,5 +1,6 @@
|
||||||
import { signIn } from "next-auth/react";
|
import { signIn } from "next-auth/react";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
import { samlProductID, samlTenantID } from "@calcom/features/ee/sso/lib/saml";
|
import { samlProductID, samlTenantID } from "@calcom/features/ee/sso/lib/saml";
|
||||||
import { HOSTED_CAL_FEATURES } from "@calcom/lib/constants";
|
import { HOSTED_CAL_FEATURES } from "@calcom/lib/constants";
|
||||||
|
@ -13,19 +14,22 @@ import PageWrapper from "@components/PageWrapper";
|
||||||
export default function Page({ samlTenantID, samlProductID }: inferSSRProps<typeof getServerSideProps>) {
|
export default function Page({ samlTenantID, samlProductID }: inferSSRProps<typeof getServerSideProps>) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
if (HOSTED_CAL_FEATURES) {
|
useEffect(() => {
|
||||||
router.push("/auth/login");
|
if (HOSTED_CAL_FEATURES) {
|
||||||
return;
|
router.push("/auth/login");
|
||||||
}
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
// Initiate SAML authentication flow
|
useEffect(() => {
|
||||||
signIn(
|
// Initiate SAML authentication flow
|
||||||
"saml",
|
signIn(
|
||||||
{
|
"saml",
|
||||||
callbackUrl: "/",
|
{
|
||||||
},
|
callbackUrl: "/",
|
||||||
{ tenant: samlTenantID, product: samlProductID }
|
},
|
||||||
);
|
{ tenant: samlTenantID, product: samlProductID }
|
||||||
|
);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue