From d83537005f72256efafa96f87feee0bfa2c56b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Bl=C3=A4ttlinger?= <69153350+andreas-blaettlinger@users.noreply.github.com> Date: Tue, 11 Jun 2024 13:29:05 +0200 Subject: [PATCH] Fix rotated secret (#30331) Signed-off-by: Andreas Blaettlinger --- js/apps/admin-ui/src/clients/credentials/ClientSecret.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/apps/admin-ui/src/clients/credentials/ClientSecret.tsx b/js/apps/admin-ui/src/clients/credentials/ClientSecret.tsx index 70dd1f25c4..d25142ff0d 100644 --- a/js/apps/admin-ui/src/clients/credentials/ClientSecret.tsx +++ b/js/apps/admin-ui/src/clients/credentials/ClientSecret.tsx @@ -8,7 +8,7 @@ import { Split, SplitItem, } from "@patternfly/react-core"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { useFormContext } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { PasswordInput } from "@keycloak/keycloak-ui-shared"; @@ -121,6 +121,12 @@ export const ClientSecret = ({ client, secret, toggle }: ClientSecretProps) => { }, }); + useEffect(() => { + if (secretRotated !== client.attributes?.["client.secret.rotated"]) { + setSecretRotated(client.attributes?.["client.secret.rotated"]); + } + }, [client, secretRotated]); + return ( <>