fix: require reCAPTCHA token when reCAPTCHA is enabled (#12409)

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: hieptl <hieptl.developer@gmail.com>
This commit is contained in:
Tim O'Farrell
2026-01-14 12:34:09 -07:00
committed by GitHub
parent 6ccd42bb29
commit f28ab56cc3
3 changed files with 13 additions and 4 deletions

View File

@@ -12,7 +12,6 @@ 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;
@@ -39,7 +38,7 @@ export function LoginContent({
// reCAPTCHA - only need token generation, verification happens at backend callback
const { isReady: recaptchaReady, executeRecaptcha } = useRecaptcha({
siteKey: ENABLE_RECAPTCHA() ? config?.RECAPTCHA_SITE_KEY : undefined,
siteKey: config?.RECAPTCHA_SITE_KEY,
});
const gitlabAuthUrl = useAuthUrl({

View File

@@ -20,4 +20,3 @@ 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");