You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-11-27 22:38:39 +02:00
More robust handling for missing email
This commit is contained in:
@@ -71,9 +71,11 @@ func newValidatorImpl(domains []string, usersFile string,
|
||||
domains[i] = fmt.Sprintf("@%s", strings.ToLower(domain))
|
||||
}
|
||||
|
||||
validator := func(email string) bool {
|
||||
validator := func(email string) (valid bool) {
|
||||
if email == "" {
|
||||
return
|
||||
}
|
||||
email = strings.ToLower(email)
|
||||
valid := false
|
||||
for _, domain := range domains {
|
||||
valid = valid || strings.HasSuffix(email, domain)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user