From a9c34cd0b6ef1beb0468a7b60ec7acd4c44fcf2f Mon Sep 17 00:00:00 2001 From: Xiao Yijun Date: Sun, 28 May 2023 09:22:15 +0800 Subject: [PATCH] fix(console): enforce SSOT for webhook signing key (#3909) --- .../src/pages/WebhookDetails/WebhookSettings/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/console/src/pages/WebhookDetails/WebhookSettings/index.tsx b/packages/console/src/pages/WebhookDetails/WebhookSettings/index.tsx index 31ff33207..93251447c 100644 --- a/packages/console/src/pages/WebhookDetails/WebhookSettings/index.tsx +++ b/packages/console/src/pages/WebhookDetails/WebhookSettings/index.tsx @@ -1,5 +1,4 @@ import { type Hook } from '@logto/schemas'; -import { useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; import { toast } from 'react-hot-toast'; import { useTranslation } from 'react-i18next'; @@ -21,7 +20,6 @@ import TestWebhook from './components/TestWebhook'; function WebhookSettings() { const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); const { hook, isDeleting, onHookUpdated } = useOutletContext(); - const [signingKey, setSigningKey] = useState(hook.signingKey); const webhookFormData = webhookDetailsParser.toLocalForm(hook); const formMethods = useForm({ defaultValues: webhookFormData, @@ -59,8 +57,10 @@ function WebhookSettings() { { + onHookUpdated({ ...hook, signingKey }); + }} />