diff --git a/web/pages/index.tsx b/web/pages/index.tsx index 0a59a802a..6c1635603 100644 --- a/web/pages/index.tsx +++ b/web/pages/index.tsx @@ -43,7 +43,7 @@ const HomePage: NextPage = observer(() => { const { setTheme } = useTheme(); const { - publicRuntimeConfig: { PROJECT_API }, + publicRuntimeConfig: { NEXT_PUBLIC_ENABLE_OAUTH }, } = getConfig() const { isLoading, mutateUser } = useUserAuth("sign-in"); @@ -178,10 +178,10 @@ const HomePage: NextPage = observer(() => {
- {parseInt(process.env.NEXT_PUBLIC_ENABLE_OAUTH || "0") ? ( + {parseInt(NEXT_PUBLIC_ENABLE_OAUTH || "0") ? ( <>

- { `Sign in to ${PROJECT_API} Plane` } + { `Sign in to Plane` }

@@ -197,7 +197,7 @@ const HomePage: NextPage = observer(() => { )} - {parseInt(process.env.NEXT_PUBLIC_ENABLE_OAUTH || "0") ? ( + {parseInt(NEXT_PUBLIC_ENABLE_OAUTH || "0") ? (

By signing up, you agree to the{" "} { const [isLoading, setIsLoading] = useState(true); + const { publicRuntimeConfig: { NEXT_PUBLIC_ENABLE_OAUTH } } = getConfig(); + const router = useRouter(); const { uidb64, token } = router.query; @@ -85,7 +88,7 @@ const ResetPasswordPage: NextPage = () => { }, [setTheme]); useEffect(() => { - if (parseInt(process.env.NEXT_PUBLIC_ENABLE_OAUTH || "0")) router.push("/"); + if (parseInt(NEXT_PUBLIC_ENABLE_OAUTH || "0")) router.push("/"); else setIsLoading(false); }, [router]); diff --git a/web/pages/sign-up.tsx b/web/pages/sign-up.tsx index 72a391ea4..9745a3074 100644 --- a/web/pages/sign-up.tsx +++ b/web/pages/sign-up.tsx @@ -18,6 +18,7 @@ import { EmailPasswordForm } from "components/account"; import { Spinner } from "components/ui"; // images import BluePlaneLogoWithoutText from "public/plane-logos/blue-without-text.png"; +import getConfig from "next/config"; // types import type { NextPage } from "next"; type EmailPasswordFormValues = { @@ -29,6 +30,8 @@ type EmailPasswordFormValues = { const SignUp: NextPage = () => { const [isLoading, setIsLoading] = useState(true); + const { publicRuntimeConfig: { NEXT_PUBLIC_ENABLE_OAUTH } } = getConfig(); + const router = useRouter(); const { setToastAlert } = useToast(); @@ -71,7 +74,7 @@ const SignUp: NextPage = () => { }, [setTheme]); useEffect(() => { - if (parseInt(process.env.NEXT_PUBLIC_ENABLE_OAUTH || "0")) router.push("/"); + if (parseInt(NEXT_PUBLIC_ENABLE_OAUTH || "0")) router.push("/"); else setIsLoading(false); }, [router]);