mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: added varaible enable OAuth
This commit is contained in:
parent
260b752ae4
commit
4aac7ffac1
@ -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(() => {
|
||||
</>
|
||||
<div className="grid place-items-center h-full overflow-y-auto py-5 px-7">
|
||||
<div>
|
||||
{parseInt(process.env.NEXT_PUBLIC_ENABLE_OAUTH || "0") ? (
|
||||
{parseInt(NEXT_PUBLIC_ENABLE_OAUTH || "0") ? (
|
||||
<>
|
||||
<h1 className="text-center text-2xl sm:text-2.5xl font-semibold text-custom-text-100">
|
||||
{ `Sign in to ${PROJECT_API} Plane` }
|
||||
{ `Sign in to Plane` }
|
||||
</h1>
|
||||
<div className="flex flex-col divide-y divide-custom-border-200">
|
||||
<div className="pb-7">
|
||||
@ -197,7 +197,7 @@ const HomePage: NextPage = observer(() => {
|
||||
<EmailPasswordForm onSubmit={handlePasswordSignIn} />
|
||||
)}
|
||||
|
||||
{parseInt(process.env.NEXT_PUBLIC_ENABLE_OAUTH || "0") ? (
|
||||
{parseInt(NEXT_PUBLIC_ENABLE_OAUTH || "0") ? (
|
||||
<p className="pt-16 text-custom-text-200 text-sm text-center">
|
||||
By signing up, you agree to the{" "}
|
||||
<a
|
||||
|
@ -19,6 +19,7 @@ import { Input, PrimaryButton, Spinner } from "components/ui";
|
||||
import BluePlaneLogoWithoutText from "public/plane-logos/blue-without-text.png";
|
||||
// types
|
||||
import type { NextPage } from "next";
|
||||
import getConfig from "next/config";
|
||||
|
||||
type FormData = {
|
||||
password: string;
|
||||
@ -28,6 +29,8 @@ type FormData = {
|
||||
const ResetPasswordPage: NextPage = () => {
|
||||
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]);
|
||||
|
||||
|
@ -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]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user