Removed the need to refresh the page (#2217)

This commit is contained in:
Erik Jan de Wit 2022-03-10 11:47:04 +01:00 committed by GitHub
parent 47a8c25c99
commit c72a9bbf06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,6 +69,12 @@ export const RealmSettingsTokensTab = ({
defaultValue: realm.offlineSessionMaxLifespanEnabled,
});
const ssoSessionIdleTimeout = useWatch({
control,
name: "ssoSessionIdleTimeout",
defaultValue: 36000,
});
return (
<PageSection variant="light">
<FormPanel
@ -205,10 +211,7 @@ export const RealmSettingsTokensTab = ({
label={t("accessTokenLifespan")}
fieldId="accessTokenLifespan"
helperText={t("recommendedSsoTimeout", {
time: toHumanFormat(
realm.ssoSessionIdleTimeout!,
whoAmI.getLocale()
),
time: toHumanFormat(ssoSessionIdleTimeout!, whoAmI.getLocale()),
})}
labelIcon={
<HelpItem
@ -225,7 +228,7 @@ export const RealmSettingsTokensTab = ({
render={({ onChange, value }) => (
<TimeSelector
validated={
value > realm.ssoSessionIdleTimeout! ? "warning" : "default"
value > ssoSessionIdleTimeout! ? "warning" : "default"
}
className="kc-access-token-lifespan"
data-testid="access-token-lifespan-input"