mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
refactor(frontend): create a feature flag for google recaptcha (#12402)
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user