1
0
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:
Jehiah Czebotar
2015-07-24 16:23:19 -04:00
parent c1bf1ad167
commit 0692c3763f
4 changed files with 7 additions and 7 deletions

View File

@@ -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)
}