Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: captcha plugin should be enabled

shuaia7bd5e348516
diff --git a/ui/src/pages/Users/Login/index.tsx b/ui/src/pages/Users/Login/index.tsx
index 52bbd00e..f0435f18 100644
--- a/ui/src/pages/Users/Login/index.tsx
+++ b/ui/src/pages/Users/Login/index.tsx
@@ -171,17 +171,6 @@ const Index: React.FC = () => {
<WelcomeTitle />
{step === 1 ? (
<Col className="mx-auto" md={6} lg={4} xl={3}>
- <PluginRender
- type="captcha"
- slug_name="captcha_basic"
- className="mb-5"
- />
-
- <PluginRender
- type="captcha"
- slug_name="captcha_google_v2"
- className="mb-5"
- />
{ucAgentInfo ? (
<PluginRender
type="connector"
diff --git a/ui/src/utils/pluginKit/index.ts b/ui/src/utils/pluginKit/index.ts
index eca058bd..3b9eaadb 100644
--- a/ui/src/utils/pluginKit/index.ts
+++ b/ui/src/utils/pluginKit/index.ts
@@ -188,7 +188,7 @@ const mergeRoutePlugins = (routes) => {
const useCaptchaPlugin = (key: Type.CaptchaKey) => {
const captcha = plugins
.getPlugins()
- .filter((plugin) => plugin.info.type === 'captcha');
+ .filter((plugin) => plugin.info.type === 'captcha' && plugin.activated);
const pluginHooks = plugins.getOnePluginHooks(captcha[0]?.info.slug_name);
return pluginHooks?.useCaptcha?.(key);
};
diff --git a/ui/src/utils/pluginKit/interface.ts b/ui/src/utils/pluginKit/interface.ts
deleted file mode 100644
index d4376764..00000000
--- a/ui/src/utils/pluginKit/interface.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-export type PluginType = 'connector' | 'search' | 'editor' | 'captcha';
-
-export interface PluginInfo {
- slug_name: string;
- type: PluginType;
- name?: string;
- description?: string;
-}