mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 00:26:24 +00:00
hide sign up with inviteOnlySignup=true
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import express, { Request, Response } from "express";
|
import express, { Request, Response } from "express";
|
||||||
import { getSecretScanningGitAppId, getSecretScanningPrivateKey, getSecretScanningWebhookSecret, getSmtpConfigured } from "../../config";
|
import { getInviteOnlySignup, getSecretScanningGitAppId, getSecretScanningPrivateKey, getSecretScanningWebhookSecret, getSmtpConfigured } from "../../config";
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
@@ -11,6 +11,7 @@ router.get(
|
|||||||
message: "Ok",
|
message: "Ok",
|
||||||
emailConfigured: await getSmtpConfigured(),
|
emailConfigured: await getSmtpConfigured(),
|
||||||
secretScanningConfigured: await getSecretScanningGitAppId() && await getSecretScanningWebhookSecret() && await getSecretScanningPrivateKey(),
|
secretScanningConfigured: await getSecretScanningGitAppId() && await getSecretScanningWebhookSecret() && await getSecretScanningPrivateKey(),
|
||||||
|
inviteOnlySignup: await getInviteOnlySignup()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,4 +2,6 @@ export type ServerStatus = {
|
|||||||
date: string;
|
date: string;
|
||||||
message: string;
|
message: string;
|
||||||
emailConfigured: boolean;
|
emailConfigured: boolean;
|
||||||
|
inviteOnlySignup: boolean;
|
||||||
|
secretScanningConfigured: boolean
|
||||||
};
|
};
|
||||||
@@ -11,6 +11,7 @@ import { useNotificationContext } from "@app/components/context/Notifications/No
|
|||||||
import attemptCliLogin from "@app/components/utilities/attemptCliLogin";
|
import attemptCliLogin from "@app/components/utilities/attemptCliLogin";
|
||||||
import attemptLogin from "@app/components/utilities/attemptLogin";
|
import attemptLogin from "@app/components/utilities/attemptLogin";
|
||||||
import { Button, Input } from "@app/components/v2";
|
import { Button, Input } from "@app/components/v2";
|
||||||
|
import { useFetchServerStatus } from "@app/hooks/api/serverDetails";
|
||||||
import getOrganizations from "@app/pages/api/organization/getOrgs";
|
import getOrganizations from "@app/pages/api/organization/getOrgs";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -34,7 +35,7 @@ export const InitialStep = ({
|
|||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [loginError, setLoginError] = useState(false);
|
const [loginError, setLoginError] = useState(false);
|
||||||
const [loginEmailChosen, setLoginEmailChosen] = useState(false);
|
const [loginEmailChosen, setLoginEmailChosen] = useState(false);
|
||||||
|
const { data: serverDetails } = useFetchServerStatus();
|
||||||
const queryParams = new URLSearchParams(window.location.search);
|
const queryParams = new URLSearchParams(window.location.search);
|
||||||
|
|
||||||
const handleLogin = async (e: FormEvent<HTMLFormElement>) => {
|
const handleLogin = async (e: FormEvent<HTMLFormElement>) => {
|
||||||
@@ -200,12 +201,15 @@ export const InitialStep = ({
|
|||||||
Continue with SAML SSO
|
Continue with SAML SSO
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-6 text-bunker-400 text-sm flex flex-row">
|
{
|
||||||
<span className="mr-1">Don't have an acount yet?</span>
|
!serverDetails?.inviteOnlySignup ?
|
||||||
<Link href="/signup">
|
<div className="mt-6 text-bunker-400 text-sm flex flex-row">
|
||||||
<span className='hover:underline hover:underline-offset-4 hover:decoration-primary-700 hover:text-bunker-200 duration-200 cursor-pointer'>{t("login.create-account")}</span>
|
<span className="mr-1">Don't have an acount yet?</span>
|
||||||
</Link>
|
<Link href="/signup">
|
||||||
</div>
|
<span className='hover:underline hover:underline-offset-4 hover:decoration-primary-700 hover:text-bunker-200 duration-200 cursor-pointer'>{t("login.create-account")}</span>
|
||||||
|
</Link>
|
||||||
|
</div> : <div />
|
||||||
|
}
|
||||||
<div className="text-bunker-400 text-sm flex flex-row">
|
<div className="text-bunker-400 text-sm flex flex-row">
|
||||||
<span className="mr-1">Forgot password?</span>
|
<span className="mr-1">Forgot password?</span>
|
||||||
<Link href="/verify-email">
|
<Link href="/verify-email">
|
||||||
|
|||||||
Reference in New Issue
Block a user