diff --git a/.env.template b/.env.template index c79407a7..bf025d8d 100644 --- a/.env.template +++ b/.env.template @@ -587,7 +587,7 @@ ## Note that the checkbox would still be present, but ignored. # DISABLE_2FA_REMEMBER=false ## -## Number of days before a remembered 2FA login expires (min: 1, max: 3650). +## Number of days before a remembered 2FA login expires (min: 1, max: 365). # TWO_FACTOR_REMEMBER_DAYS=30 ## ## Authenticator Settings diff --git a/src/config.rs b/src/config.rs index b148fc69..9ef31b61 100644 --- a/src/config.rs +++ b/src/config.rs @@ -705,7 +705,7 @@ make_config! { /// 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. disable_2fa_remember: bool, true, def, false; - /// Two-Factor remember duration |> Number of days before a remembered Two-Factor login expires (min: 1, max: 3650). + /// 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 @@ -1211,8 +1211,8 @@ fn validate_config(cfg: &ConfigItems, on_update: bool) -> Result<(), Error> { err!("`INVITATION_EXPIRATION_HOURS` has a minimum duration of 1 hour") } - if !(1..=3650).contains(&cfg.two_factor_remember_days) { - err!("`TWO_FACTOR_REMEMBER_DAYS` must be between 1 and 3650 days") + 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