Remove "Revoke Refresh Token" when not revoke on (#2234)
This commit is contained in:
parent
d85fc18a63
commit
883e59a5a3
1 changed files with 35 additions and 27 deletions
|
@ -75,6 +75,12 @@ export const RealmSettingsTokensTab = ({
|
||||||
defaultValue: 36000,
|
defaultValue: 36000,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const revokeRefreshToken = useWatch({
|
||||||
|
control,
|
||||||
|
name: "revokeRefreshToken",
|
||||||
|
defaultValue: false,
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageSection variant="light">
|
<PageSection variant="light">
|
||||||
<FormPanel
|
<FormPanel
|
||||||
|
@ -167,34 +173,36 @@ export const RealmSettingsTokensTab = ({
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
<FormGroup
|
{revokeRefreshToken && (
|
||||||
label={t("refreshTokenMaxReuse")}
|
<FormGroup
|
||||||
labelIcon={
|
label={t("refreshTokenMaxReuse")}
|
||||||
<HelpItem
|
labelIcon={
|
||||||
helpText="realm-settings-help:refreshTokenMaxReuse"
|
<HelpItem
|
||||||
fieldLabelId="realm-settings:refreshTokenMaxReuse"
|
helpText="realm-settings-help:refreshTokenMaxReuse"
|
||||||
/>
|
fieldLabelId="realm-settings:refreshTokenMaxReuse"
|
||||||
}
|
|
||||||
fieldId="refreshTokenMaxReuse"
|
|
||||||
>
|
|
||||||
<Controller
|
|
||||||
name="refreshTokenMaxReuse"
|
|
||||||
defaultValue={0}
|
|
||||||
control={form.control}
|
|
||||||
render={({ onChange, value }) => (
|
|
||||||
<NumberInput
|
|
||||||
type="text"
|
|
||||||
id="refreshTokenMaxReuseMs"
|
|
||||||
value={value}
|
|
||||||
onPlus={() => onChange(value + 1)}
|
|
||||||
onMinus={() => onChange(value - 1)}
|
|
||||||
onChange={(event) =>
|
|
||||||
onChange(Number((event.target as HTMLInputElement).value))
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
)}
|
}
|
||||||
/>
|
fieldId="refreshTokenMaxReuse"
|
||||||
</FormGroup>
|
>
|
||||||
|
<Controller
|
||||||
|
name="refreshTokenMaxReuse"
|
||||||
|
defaultValue={0}
|
||||||
|
control={form.control}
|
||||||
|
render={({ onChange, value }) => (
|
||||||
|
<NumberInput
|
||||||
|
type="text"
|
||||||
|
id="refreshTokenMaxReuseMs"
|
||||||
|
value={value}
|
||||||
|
onPlus={() => onChange(value + 1)}
|
||||||
|
onMinus={() => onChange(value - 1)}
|
||||||
|
onChange={(event) =>
|
||||||
|
onChange(Number((event.target as HTMLInputElement).value))
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
)}
|
||||||
</FormAccess>
|
</FormAccess>
|
||||||
</FormPanel>
|
</FormPanel>
|
||||||
<FormPanel
|
<FormPanel
|
||||||
|
|
Loading…
Reference in a new issue