Added refresh after generate and update (#3514)
This commit is contained in:
parent
b928418da1
commit
3374780a1d
1 changed files with 5 additions and 1 deletions
|
@ -54,6 +54,8 @@ export const Keys = ({ clientId, save, hasConfigureAccess }: KeysProps) => {
|
||||||
const [openGenerateKeys, toggleOpenGenerateKeys, setOpenGenerateKeys] =
|
const [openGenerateKeys, toggleOpenGenerateKeys, setOpenGenerateKeys] =
|
||||||
useToggle();
|
useToggle();
|
||||||
const [openImportKeys, toggleOpenImportKeys, setOpenImportKeys] = useToggle();
|
const [openImportKeys, toggleOpenImportKeys, setOpenImportKeys] = useToggle();
|
||||||
|
const [key, setKey] = useState(0);
|
||||||
|
const refresh = () => setKey(key + 1);
|
||||||
|
|
||||||
const useJwksUrl = useWatch({
|
const useJwksUrl = useWatch({
|
||||||
control,
|
control,
|
||||||
|
@ -64,7 +66,7 @@ export const Keys = ({ clientId, save, hasConfigureAccess }: KeysProps) => {
|
||||||
useFetch(
|
useFetch(
|
||||||
() => adminClient.clients.getKeyInfo({ id: clientId, attr }),
|
() => adminClient.clients.getKeyInfo({ id: clientId, attr }),
|
||||||
(info) => setKeyInfo(info),
|
(info) => setKeyInfo(info),
|
||||||
[]
|
[key]
|
||||||
);
|
);
|
||||||
|
|
||||||
const generate = async (config: KeyStoreConfig) => {
|
const generate = async (config: KeyStoreConfig) => {
|
||||||
|
@ -81,6 +83,7 @@ export const Keys = ({ clientId, save, hasConfigureAccess }: KeysProps) => {
|
||||||
`keystore.${config.format == "PKCS12" ? "p12" : "jks"}`
|
`keystore.${config.format == "PKCS12" ? "p12" : "jks"}`
|
||||||
);
|
);
|
||||||
addAlert(t("generateSuccess"), AlertVariant.success);
|
addAlert(t("generateSuccess"), AlertVariant.success);
|
||||||
|
refresh();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
addError("clients:generateError", error);
|
addError("clients:generateError", error);
|
||||||
}
|
}
|
||||||
|
@ -100,6 +103,7 @@ export const Keys = ({ clientId, save, hasConfigureAccess }: KeysProps) => {
|
||||||
formData
|
formData
|
||||||
);
|
);
|
||||||
addAlert(t("importSuccess"), AlertVariant.success);
|
addAlert(t("importSuccess"), AlertVariant.success);
|
||||||
|
refresh();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
addError("clients:importError", error);
|
addError("clients:importError", error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue