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