Auth: Fix email verification bypass when using basic authentication (#82914)
This commit is contained in:
+11
-3
@@ -314,9 +314,10 @@ type Cfg struct {
|
||||
DateFormats DateFormats
|
||||
|
||||
// User
|
||||
UserInviteMaxLifetime time.Duration
|
||||
HiddenUsers map[string]struct{}
|
||||
CaseInsensitiveLogin bool // Login and Email will be considered case insensitive
|
||||
UserInviteMaxLifetime time.Duration
|
||||
HiddenUsers map[string]struct{}
|
||||
CaseInsensitiveLogin bool // Login and Email will be considered case insensitive
|
||||
VerificationEmailMaxLifetime time.Duration
|
||||
|
||||
// Service Accounts
|
||||
SATokenExpirationDayLimit int
|
||||
@@ -1700,6 +1701,13 @@ func readUserSettings(iniFile *ini.File, cfg *Cfg) error {
|
||||
}
|
||||
}
|
||||
|
||||
verificationEmailMaxLifetimeVal := valueAsString(users, "verification_email_max_lifetime_duration", "1h")
|
||||
verificationEmailMaxLifetimeDuration, err := gtime.ParseDuration(verificationEmailMaxLifetimeVal)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cfg.VerificationEmailMaxLifetime = verificationEmailMaxLifetimeDuration
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user