From 83ce18bfdc1a0a6d7ecb88cfa2ce1cdf1bd4d592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Lo=CC=81pez?= Date: Wed, 12 Jan 2022 21:00:48 -0700 Subject: [PATCH] Prevents constant collision --- pages/auth/login.tsx | 5 +++-- pages/auth/signup.tsx | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pages/auth/login.tsx b/pages/auth/login.tsx index 085f841573..b456b25fc1 100644 --- a/pages/auth/login.tsx +++ b/pages/auth/login.tsx @@ -4,7 +4,7 @@ import Link from "next/link"; import { useRouter } from "next/router"; import { useState } from "react"; -import { ErrorCode, getSession, isGoogleLoginEnabled } from "@lib/auth"; +import { ErrorCode, getSession } from "@lib/auth"; import { WEBSITE_URL } from "@lib/config/constants"; import { useLocale } from "@lib/hooks/useLocale"; import { isSAMLLoginEnabled, hostedCal, samlTenantID, samlProductID } from "@lib/saml"; @@ -15,6 +15,7 @@ import Loader from "@components/Loader"; import { EmailInput } from "@components/form/fields"; import { HeadSeo } from "@components/seo/head-seo"; +import { IS_GOOGLE_LOGIN_ENABLED } from "@server/lib/constants"; import { ssrInit } from "@server/lib/ssr"; export default function Login({ @@ -267,7 +268,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { props: { csrfToken: await getCsrfToken(context), trpcState: ssr.dehydrate(), - isGoogleLoginEnabled, + isGoogleLoginEnabled: IS_GOOGLE_LOGIN_ENABLED, isSAMLLoginEnabled, hostedCal, samlTenantID, diff --git a/pages/auth/signup.tsx b/pages/auth/signup.tsx index b5e979520a..7dc1b3f1aa 100644 --- a/pages/auth/signup.tsx +++ b/pages/auth/signup.tsx @@ -1,10 +1,9 @@ import { GetServerSidePropsContext } from "next"; import { signIn } from "next-auth/react"; import { useRouter } from "next/router"; -import { useForm, SubmitHandler, FormProvider } from "react-hook-form"; +import { FormProvider, SubmitHandler, useForm } from "react-hook-form"; import { asStringOrNull } from "@lib/asStringOrNull"; -import { isGoogleLoginEnabled } from "@lib/auth"; import { useLocale } from "@lib/hooks/useLocale"; import prisma from "@lib/prisma"; import { isSAMLLoginEnabled } from "@lib/saml"; @@ -15,6 +14,7 @@ import { HeadSeo } from "@components/seo/head-seo"; import { Alert } from "@components/ui/Alert"; import Button from "@components/ui/Button"; +import { IS_GOOGLE_LOGIN_ENABLED } from "@server/lib/constants"; import { ssrInit } from "@server/lib/ssr"; type Props = inferSSRProps; @@ -183,7 +183,7 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => { return { props: { - isGoogleLoginEnabled, + isGoogleLoginEnabled: IS_GOOGLE_LOGIN_ENABLED, isSAMLLoginEnabled, email: verificationRequest.identifier, trpcState: ssr.dehydrate(),