Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Merge branch 'main' into feat/add-captcha

Maidul Islam429b2a284d65
diff --cc frontend/src/views/Login/components/InitialStep/InitialStep.tsx
index 48f7af7585,ac7df8c8fb..6e2c788ae0
--- a/frontend/src/views/Login/components/InitialStep/InitialStep.tsx
+++ b/frontend/src/views/Login/components/InitialStep/InitialStep.tsx
@@@ -11,9 -10,9 +11,10 @@@ import Error from "@app/components/basi
import { createNotification } from "@app/components/notifications";
import attemptCliLogin from "@app/components/utilities/attemptCliLogin";
import attemptLogin from "@app/components/utilities/attemptLogin";
+import { CAPTCHA_SITE_KEY } from "@app/components/utilities/config";
import { Button, Input } from "@app/components/v2";
import { useServerConfig } from "@app/context";
+ import { useFetchServerStatus } from "@app/hooks/api";
import { navigateUserToSelectOrg } from "../../Login.utils";
@@@ -33,24 -32,15 +34,18 @@@ export const InitialStep = ({ setStep,
const [loginError, setLoginError] = useState(false);
const { config } = useServerConfig();
const queryParams = new URLSearchParams(window.location.search);
+ const [captchaToken, setCaptchaToken] = useState("");
+ const [shouldShowCaptcha, setShouldShowCaptcha] = useState(false);
+ const captchaRef = useRef<HCaptcha>(null);
+ const { data: serverDetails } = useFetchServerStatus();
useEffect(() => {
- if (
- process.env.NEXT_PUBLIC_SAML_ORG_SLUG &&
- process.env.NEXT_PUBLIC_SAML_ORG_SLUG !== "saml-org-slug-default"
- ) {
- const callbackPort = queryParams.get("callback_port");
- window.open(
- `/api/v1/sso/redirect/saml2/organizations/${process.env.NEXT_PUBLIC_SAML_ORG_SLUG}${
- callbackPort ? `?callback_port=${callbackPort}` : ""
- }`
- );
- window.close();
- }
- }, []);
+ if (serverDetails?.samlDefaultOrgSlug){
+ const callbackPort = queryParams.get("callback_port");
+ const redirectUrl = `/api/v1/sso/redirect/saml2/organizations/${serverDetails?.samlDefaultOrgSlug}${callbackPort ? `?callback_port=${callbackPort}` : ""}`
+ router.push(redirectUrl);
+ }
+ }, [serverDetails?.samlDefaultOrgSlug]);
const handleLogin = async (e: FormEvent<HTMLFormElement>) => {
e.preventDefault();