refactor(frontend): create a feature flag for google recaptcha (#12402)

This commit is contained in:
Hiep Le
2026-01-14 19:22:38 +07:00
committed by GitHub
parent ff28e13698
commit 1146ea2274
2 changed files with 3 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ import { TermsAndPrivacyNotice } from "#/components/shared/terms-and-privacy-not
import { useRecaptcha } from "#/hooks/use-recaptcha";
import { useConfig } from "#/hooks/query/use-config";
import { displayErrorToast } from "#/utils/custom-toast-handlers";
import { ENABLE_RECAPTCHA } from "#/utils/feature-flags";
export interface LoginContentProps {
githubAuthUrl: string | null;
@@ -38,7 +39,7 @@ export function LoginContent({
// reCAPTCHA - only need token generation, verification happens at backend callback
const { isReady: recaptchaReady, executeRecaptcha } = useRecaptcha({
siteKey: config?.RECAPTCHA_SITE_KEY,
siteKey: ENABLE_RECAPTCHA() ? config?.RECAPTCHA_SITE_KEY : undefined,
});
const gitlabAuthUrl = useAuthUrl({

View File

@@ -20,3 +20,4 @@ export const ENABLE_TRAJECTORY_REPLAY = () =>
export const USE_PLANNING_AGENT = () => loadFeatureFlag("USE_PLANNING_AGENT");
export const ENABLE_PUBLIC_CONVERSATION_SHARING = () =>
loadFeatureFlag("PUBLIC_CONVERSATION_SHARING");
export const ENABLE_RECAPTCHA = () => loadFeatureFlag("RECAPTCHA");