Run gofmt on domain validation code

This commit is contained in:
Vladimir DOMBROVSKI 2025-05-05 14:03:41 +02:00
parent 7732a9232b
commit daf07ddf25

View File

@ -394,22 +394,21 @@ func (a *Authenticator) randString(nByte int) (string, error) {
return base64.RawURLEncoding.EncodeToString(b), nil return base64.RawURLEncoding.EncodeToString(b), nil
} }
func isDomainAllowed(email string, allowedDomains []string) bool { func isDomainAllowed(email string, allowedDomains []string) bool {
if len(allowedDomains) == 0 { if len(allowedDomains) == 0 {
return true return true
} }
parts := strings.Split(email, "@") parts := strings.Split(email, "@")
if len(parts) != 2 { if len(parts) != 2 {
return false return false
} }
domain := strings.ToLower(parts[1]) domain := strings.ToLower(parts[1])
for _, allowed := range allowedDomains { for _, allowed := range allowedDomains {
if domain == strings.ToLower(allowed) { if domain == strings.ToLower(allowed) {
return true return true
} }
} }
return false return false
} }
// OauthLoginStep2 finishes the oauth authentication flow by exchanging the code for an access token and // OauthLoginStep2 finishes the oauth authentication flow by exchanging the code for an access token and