Fix rotated secret (#30331) (#30887)

Signed-off-by: Andreas Blaettlinger <bln1imb@bosch.com>
(cherry picked from commit d83537005f72256efafa96f87feee0bfa2c56b91)

Co-authored-by: Andreas Blättlinger <69153350+andreas-blaettlinger@users.noreply.github.com>
This commit is contained in:
Jon Koops 2024-06-27 19:15:36 +02:00 committed by GitHub
parent ddccf58327
commit 041c7d6b5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 (
<>
<InvalidateConfirm />