diff --git a/src/settingsCategories.js b/src/settingsCategories.js index 363b9215..774a86da 100644 --- a/src/settingsCategories.js +++ b/src/settingsCategories.js @@ -123,6 +123,7 @@ export const categories = { 'keyAllowObjectAssignment', 'credentialsExpires', 'credentialsExpiryAlert', + 'credentialsExpiresReminderInDays', 'minPasswordLength', 'corsWhitelist', 'recaptchaSite', diff --git a/src/settingsFields.component.js b/src/settingsFields.component.js index af4c8236..e20c631e 100644 --- a/src/settingsFields.component.js +++ b/src/settingsFields.component.js @@ -319,6 +319,9 @@ class SettingsFields extends React.Component { ...addConditionallyHiddenStyles(mapping), }, hintText: mapping.hintText, + type: mapping.inputType, + min: mapping.minValue, + max: mapping.maxValue, }, validators, } diff --git a/src/settingsKeyMapping.js b/src/settingsKeyMapping.js index 8517e90b..35f9938d 100644 --- a/src/settingsKeyMapping.js +++ b/src/settingsKeyMapping.js @@ -553,9 +553,22 @@ const settingsKeyMapping = { }, }, credentialsExpiryAlert: { - label: i18n.t('Enable password expiry alerts'), + label: i18n.t('Send reminders to users before their password expires'), type: 'checkbox', }, + credentialsExpiresReminderInDays: { + label: i18n.t( + 'Number of days before password expiry to send reminder (1–28)' + ), + type: 'textfield', + inputType: 'number', + minValue: 1, + maxValue: 28, + hideWhen: { + settingsKey: 'credentialsExpiryAlert', + settingsValue: 'false', + }, + }, minPasswordLength: { label: i18n.t('Minimum characters in password'), type: 'dropdown',