|
|
@ -705,6 +705,8 @@ make_config! { |
|
|
/// Disable Two-Factor remember |> Enabling this would force the users to use a second factor to login every time.
|
|
|
/// Disable Two-Factor remember |> Enabling this would force the users to use a second factor to login every time.
|
|
|
/// Note that the checkbox would still be present, but ignored.
|
|
|
/// Note that the checkbox would still be present, but ignored.
|
|
|
disable_2fa_remember: bool, true, def, false; |
|
|
disable_2fa_remember: bool, true, def, false; |
|
|
|
|
|
/// Two-Factor remember duration |> Number of days before a remembered Two-Factor login expires (min: 1, max: 365).
|
|
|
|
|
|
two_factor_remember_days: i64, true, def, 30; |
|
|
|
|
|
|
|
|
/// Disable authenticator time drifted codes to be valid |> Enabling this only allows the current TOTP code to be valid
|
|
|
/// Disable authenticator time drifted codes to be valid |> Enabling this only allows the current TOTP code to be valid
|
|
|
/// TOTP codes of the previous and next 30 seconds will be invalid.
|
|
|
/// TOTP codes of the previous and next 30 seconds will be invalid.
|
|
|
@ -1209,6 +1211,10 @@ fn validate_config(cfg: &ConfigItems, on_update: bool) -> Result<(), Error> { |
|
|
err!("`INVITATION_EXPIRATION_HOURS` has a minimum duration of 1 hour") |
|
|
err!("`INVITATION_EXPIRATION_HOURS` has a minimum duration of 1 hour") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if !(1..=365).contains(&cfg.two_factor_remember_days) { |
|
|
|
|
|
err!("`TWO_FACTOR_REMEMBER_DAYS` must be between 1 and 365 days") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Validate schedule crontab format
|
|
|
// Validate schedule crontab format
|
|
|
if !cfg.send_purge_schedule.is_empty() && cfg.send_purge_schedule.parse::<Schedule>().is_err() { |
|
|
if !cfg.send_purge_schedule.is_empty() && cfg.send_purge_schedule.parse::<Schedule>().is_err() { |
|
|
err!("`SEND_PURGE_SCHEDULE` is not a valid cron expression") |
|
|
err!("`SEND_PURGE_SCHEDULE` is not a valid cron expression") |
|
|
|