diff --git a/backend/src/routes/status/status.ts b/backend/src/routes/status/status.ts index ce13775cb..c6038846e 100644 --- a/backend/src/routes/status/status.ts +++ b/backend/src/routes/status/status.ts @@ -1,5 +1,5 @@ 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(); @@ -11,6 +11,7 @@ router.get( message: "Ok", emailConfigured: await getSmtpConfigured(), secretScanningConfigured: await getSecretScanningGitAppId() && await getSecretScanningWebhookSecret() && await getSecretScanningPrivateKey(), + inviteOnlySignup: await getInviteOnlySignup() }) } ); diff --git a/frontend/src/hooks/api/serverDetails/types.ts b/frontend/src/hooks/api/serverDetails/types.ts index 0deb90a38..ad9ed24e8 100644 --- a/frontend/src/hooks/api/serverDetails/types.ts +++ b/frontend/src/hooks/api/serverDetails/types.ts @@ -2,4 +2,6 @@ export type ServerStatus = { date: string; message: string; emailConfigured: boolean; + inviteOnlySignup: boolean; + secretScanningConfigured: boolean }; \ No newline at end of file diff --git a/frontend/src/views/Login/components/InitialStep/InitialStep.tsx b/frontend/src/views/Login/components/InitialStep/InitialStep.tsx index 3f436e88e..afd82abd0 100644 --- a/frontend/src/views/Login/components/InitialStep/InitialStep.tsx +++ b/frontend/src/views/Login/components/InitialStep/InitialStep.tsx @@ -11,6 +11,7 @@ import { useNotificationContext } from "@app/components/context/Notifications/No import attemptCliLogin from "@app/components/utilities/attemptCliLogin"; import attemptLogin from "@app/components/utilities/attemptLogin"; import { Button, Input } from "@app/components/v2"; +import { useFetchServerStatus } from "@app/hooks/api/serverDetails"; import getOrganizations from "@app/pages/api/organization/getOrgs"; type Props = { @@ -34,7 +35,7 @@ export const InitialStep = ({ const [isLoading, setIsLoading] = useState(false); const [loginError, setLoginError] = useState(false); const [loginEmailChosen, setLoginEmailChosen] = useState(false); - + const { data: serverDetails } = useFetchServerStatus(); const queryParams = new URLSearchParams(window.location.search); const handleLogin = async (e: FormEvent) => { @@ -200,12 +201,15 @@ export const InitialStep = ({ Continue with SAML SSO -
- Don't have an acount yet? - - {t("login.create-account")} - -
+ { + !serverDetails?.inviteOnlySignup ? +
+ Don't have an acount yet? + + {t("login.create-account")} + +
:
+ }
Forgot password?