mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-30 22:23:53 +00:00
[v7.0/forgejo] fix: load settings for valid user and email check
- The doctor commands to check the validity of existing usernames and
email addresses depend on functionality that have configurable behavior
depending on the values of the `[service]` settings, so load them when
running the doctor command.
- Resolves #6664
- No unit test due to the architecture of doctor commands.
(cherry picked from commit 46e60ce966
)
This commit is contained in:
parent
9cc7b6d19e
commit
51e0b34fa8
2 changed files with 10 additions and 0 deletions
|
@ -133,6 +133,11 @@ func CompileEmailGlobList(sec ConfigSection, keys ...string) (globs []glob.Glob)
|
|||
return globs
|
||||
}
|
||||
|
||||
// LoadServiceSetting loads the service settings
|
||||
func LoadServiceSetting() {
|
||||
loadServiceFrom(CfgProvider)
|
||||
}
|
||||
|
||||
func loadServiceFrom(rootCfg ConfigProvider) {
|
||||
sec := rootCfg.Section("service")
|
||||
Service.ActiveCodeLives = sec.Key("ACTIVE_CODE_LIVE_MINUTES").MustInt(180)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue