File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed
packages/console/src/pages Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @logto/console " : patch
3+ ---
4+
5+ always show enable CAPTCHA toggle
6+
7+ Even if there is no CAPTCHA provider, the toggle will be shown but disabled.
8+
9+ Also the back link of the captcha details page is changed to ` /security/captcha ` .
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ function CaptchaDetails() {
7171
7272 return (
7373 < DetailsPage
74- backLink = "/security"
74+ backLink = "/security/captcha "
7575 backLinkTitle = "security.captcha_details.back_to_security"
7676 isLoading = { isLoading }
7777 error = { error }
Original file line number Diff line number Diff line change @@ -10,7 +10,12 @@ import { type RequestError } from '@/hooks/use-api';
1010
1111import styles from './index.module.scss' ;
1212
13- function EnableCaptcha ( ) {
13+ type Props = {
14+ // eslint-disable-next-line react/boolean-prop-naming
15+ readonly disabled ?: boolean ;
16+ } ;
17+
18+ function EnableCaptcha ( { disabled } : Props ) {
1419 const { t } = useTranslation ( undefined , { keyPrefix : 'admin_console' } ) ;
1520 const { register, reset } = useFormContext < CaptchaPolicy > ( ) ;
1621 const { data, isLoading } = useSWR < SignInExperience , RequestError > ( 'api/sign-in-exp' ) ;
@@ -32,6 +37,7 @@ function EnableCaptcha() {
3237 < Switch
3338 label = { t ( 'security.bot_protection.enable_captcha_description' ) }
3439 { ...register ( 'enabled' ) }
40+ disabled = { disabled }
3541 />
3642 </ div >
3743 </ FormField >
Original file line number Diff line number Diff line change @@ -105,10 +105,7 @@ function Captcha() {
105105 { t ( 'security.bot_protection.captcha.placeholder' ) }
106106 </ div >
107107 { data && ! isFreeTenant ? (
108- < >
109- < CaptchaCard captchaProvider = { data } />
110- < EnableCaptcha />
111- </ >
108+ < CaptchaCard captchaProvider = { data } />
112109 ) : (
113110 < Button
114111 title = "security.bot_protection.captcha.add"
@@ -119,6 +116,7 @@ function Captcha() {
119116 } }
120117 />
121118 ) }
119+ < EnableCaptcha disabled = { isFreeTenant || ! data } />
122120 </ FormField >
123121 </ FormCard >
124122 </ DetailsForm >
You can’t perform that action at this time.
0 commit comments