Auth: Fix email verification bypass when using basic authentication (#83484)

This commit is contained in:
grafana-delivery-bot[bot]
2024-02-27 16:35:31 +01:00
committed by GitHub
parent b51b4f987f
commit 8d687b4796
21 changed files with 1397 additions and 16 deletions
+11 -3
View File
@@ -378,9 +378,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
@@ -1689,6 +1690,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
}