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

This commit is contained in:
grafana-delivery-bot[bot]
2024-02-27 16:35:42 +01:00
committed by GitHub
parent 0c72a4e47e
commit efec060256
22 changed files with 1347 additions and 16 deletions
+11 -3
View File
@@ -370,9 +370,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
@@ -1724,6 +1725,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
}