feat: useRecaptchaNet

This commit is contained in:
DIYgod 2025-03-06 22:01:04 +08:00
parent 27cf62cc48
commit 2a360161dc
No known key found for this signature in database
3 changed files with 15 additions and 8 deletions

View File

@ -50,10 +50,3 @@ if (process.contextIsolated) {
// @ts-ignore (define in dts)
window.platform = process.platform
}
// Options for react-google-recaptcha
// @ts-ignore (define in dts)
window.recaptchaOptions = {
useRecaptchaNet: true,
enterprise: true,
}

View File

@ -34,6 +34,10 @@ const cleanup = subscribeShouldUseIndexedDB((value) => {
declare global {
interface Window {
version: string
recaptchaOptions: {
useRecaptchaNet: boolean
enterprise: boolean
}
}
}
@ -118,6 +122,12 @@ export const initializeApp = async () => {
data_hydrated_time: dataHydratedTime,
version: APP_VERSION,
})
// Options for react-google-recaptcha
window.recaptchaOptions = {
useRecaptchaNet: true,
enterprise: true,
}
}
import.meta.hot?.dispose(cleanup)

View File

@ -34,7 +34,11 @@ import { SettingSync } from "./setting-sync"
import { UserProvider } from "./user-provider"
export const RootProviders: FC<PropsWithChildren> = ({ children }) => (
<GoogleReCaptchaProvider reCaptchaKey={env.VITE_RECAPTCHA_V3_SITE_KEY} useEnterprise={true}>
<GoogleReCaptchaProvider
reCaptchaKey={env.VITE_RECAPTCHA_V3_SITE_KEY}
useEnterprise={true}
useRecaptchaNet={true}
>
<MotionProvider>
<PersistQueryClientProvider persistOptions={persistConfig} client={queryClient}>
<HotkeysProvider initiallyActiveScopes={HotKeyScopeMap.Home}>