From 683e8c449027ca5782ebd0f2e5609420e7958440 Mon Sep 17 00:00:00 2001 From: zomars Date: Tue, 17 May 2022 10:52:45 -0600 Subject: [PATCH] Fixes infinite loop --- apps/web/pages/auth/logout.tsx | 10 +++++----- apps/web/pages/auth/sso/[provider].tsx | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/web/pages/auth/logout.tsx b/apps/web/pages/auth/logout.tsx index 70fcb675c6..1be2a675f6 100644 --- a/apps/web/pages/auth/logout.tsx +++ b/apps/web/pages/auth/logout.tsx @@ -1,14 +1,13 @@ import { CheckIcon } from "@heroicons/react/outline"; import { GetServerSidePropsContext } from "next"; -import { useSession, signOut } from "next-auth/react"; -import { getCookieParser } from "next/dist/server/api-utils"; +import { signOut, useSession } from "next-auth/react"; import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect } from "react"; +import { useLocale } from "@calcom/lib/hooks/useLocale"; import Button from "@calcom/ui/Button"; -import { useLocale } from "@lib/hooks/useLocale"; import { inferSSRProps } from "@lib/types/inferSSRProps"; import AuthContainer from "@components/ui/AuthContainer"; @@ -18,14 +17,15 @@ import { ssrInit } from "@server/lib/ssr"; type Props = inferSSRProps; export default function Logout(props: Props) { - const { data: session, status } = useSession(); + const { status } = useSession(); if (status === "authenticated") signOut({ redirect: false }); const router = useRouter(); useEffect(() => { if (props.query?.survey === "true") { router.push("https://cal.com/cancellation"); } - }, [props.query?.survey, router]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [props.query?.survey]); const { t } = useLocale(); return ( diff --git a/apps/web/pages/auth/sso/[provider].tsx b/apps/web/pages/auth/sso/[provider].tsx index 1c8e914d41..719caf1f3f 100644 --- a/apps/web/pages/auth/sso/[provider].tsx +++ b/apps/web/pages/auth/sso/[provider].tsx @@ -38,7 +38,8 @@ export default function Provider(props: SSOProviderPageProps) { } else { signIn(props.provider); } - }, [props.isSAMLLoginEnabled, props.product, props.provider, props.tenant, router]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); return null; }