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 ( <>