update client after import (#39056) (#39387)

fixes: #39055

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
(cherry picked from commit 338ff88b06cb0c1af86387c0721c8eb58fc75818)
This commit is contained in:
Erik Jan de Wit 2025-05-01 19:18:51 +02:00 committed by GitHub
parent b4b6e086a3
commit 4411020cde
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 3 deletions

View File

@ -215,6 +215,7 @@ export default function ClientDetails() {
const form = useForm<FormFields>();
const { clientId } = useParams<ClientParams>();
const [key, setKey] = useState(0);
const refresh = () => setKey(key + 1);
const isAdminPermissionsClient = useIsAdminPermissionsClient(clientId);
@ -465,6 +466,7 @@ export default function ClientDetails() {
<Keys
clientId={clientId}
save={save}
refresh={refresh}
hasConfigureAccess={client.access?.configure}
/>
)}
@ -487,7 +489,7 @@ export default function ClientDetails() {
key={key}
client={client}
save={save}
refresh={() => setKey(key + 1)}
refresh={refresh}
/>
</Tab>
)}

View File

@ -29,13 +29,19 @@ import { ImportFile, ImportKeyDialog } from "./ImportKeyDialog";
type KeysProps = {
save: () => void;
refresh: () => void;
clientId: string;
hasConfigureAccess?: boolean;
};
const attr = "jwt.credential";
export const Keys = ({ clientId, save, hasConfigureAccess }: KeysProps) => {
export const Keys = ({
clientId,
save,
refresh: refreshParent,
hasConfigureAccess,
}: KeysProps) => {
const { adminClient } = useAdminClient();
const { t } = useTranslation();
@ -51,7 +57,10 @@ export const Keys = ({ clientId, save, hasConfigureAccess }: KeysProps) => {
useToggle();
const [openImportKeys, toggleOpenImportKeys, setOpenImportKeys] = useToggle();
const [key, setKey] = useState(0);
const refresh = () => setKey(key + 1);
const refresh = () => {
setKey(key + 1);
refreshParent();
};
const useJwksUrl = useWatch({
control,