File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
packages/console/src/pages/Security/Captcha Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { useContext, useState } from 'react';
33import { FormProvider , useForm } from 'react-hook-form' ;
44import { toast } from 'react-hot-toast' ;
55import { useTranslation } from 'react-i18next' ;
6+ import { useSWRConfig } from 'swr' ;
67
78import Plus from '@/assets/icons/plus.svg?react' ;
89import DetailsForm from '@/components/DetailsForm' ;
@@ -45,6 +46,8 @@ function CaptchaForm({ captchaProvider, formData }: Props) {
4546 } = formMethods ;
4647 const api = useApi ( ) ;
4748
49+ const { mutate : mutateGlobal } = useSWRConfig ( ) ;
50+
4851 const onSubmit = trySubmitSafe ( async ( data : CaptchaPolicy ) => {
4952 const { captchaPolicy } = await api
5053 . patch ( 'api/sign-in-exp' , {
@@ -53,6 +56,9 @@ function CaptchaForm({ captchaProvider, formData }: Props) {
5356 . json < SignInExperience > ( ) ;
5457 reset ( captchaPolicy ) ;
5558 mutateSubscriptionQuotaAndUsages ( ) ;
59+
60+ // Global mutate the SIE data
61+ await mutateGlobal ( 'api/sign-in-exp' ) ;
5662 toast . success ( t ( 'general.saved' ) ) ;
5763 } ) ;
5864
You can’t perform that action at this time.
0 commit comments